DroidForums.net is the original Verizon Android Forum! Registered Users do not see these ads. Please Register - It's Free!
Page 3 of 3 FirstFirst 1 2 3
Results 21 to 27 of 27

Thread: [How To] Make Script Run By Using Hardware Keys

  1. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #21
    Quote Originally Posted by Se7enLC View Post
    Quote Originally Posted by peteralfonso View Post
    To add these options to your boot.img add the following lines to your preferred init script inside the ramdisk before compiling.
    Aha, inside the ramdisk! It all makes sense now...

    So unfortunately, to make a change to this means recompiling a kernel, which means that most people won't do it :-P

    Guess it's about time I learn how to compile an android kernel (can't be that different from std linux, right?)
    Ahh, correction to my previous statement - modifying the ramdisk does NOT require recompiling the kernel - it only requires rebuilding the boot.img file! And now with this new kernel update format, the boot.img is actually generated when you apply the update - so it's just a matter of updating the ramdisk image and using that instead of the default. I'll poke around and post if I have a good way to do this. I'd LOVE to remap those reboot keys to be something on the keyboard so that I have easy access without pulling off my case, but no way of accidentally triggering it.

    Details: The anyrom update format does the following:
    1). Read the current boot partition and dump the boot.img to /tmp
    2). Unpack that boot.img, extracting out the kernel and ramdisk images to /tmp
    3). Repack it using the new kernel with the old ramdisk
    4). Write that image to the boot partition
    Last edited by Se7enLC; 06-21-2010 at 10:31 AM.
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  2. Senior Droid
    bad4u's Avatar
    Member #
    8302
    Join Date
    Nov 2009
    Posts
    226
    Phone
    moto droid
    #22
    To remap it to the keyboard keys I think its going to have to be ones that dont cause something to happen already. By this I mean pressing any letter brings up the search bar and starts typing. For mine I was going to change it to X+power for reboot recovery, but once you press x it just keeps typing x.

    It appears the alt, shift, del, and return buttons dont do anything when pressed if at your homescreen.
    Themed swypes and stock keybrd for DX .. http://tinyurl.com/22q7mh2
  3. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #23
    Success! I modified init.sholes.rc, re-generated a ramdisk, and modified one of the kernel install zip files to apply it.

    Here's a page that explains the process of building / extracting ramdisk images:
    HOWTO: Unpack, Edit, and Re-Pack Boot Images - Android Wiki

    The modification I made to the kernel update.zip file was to add the file boot.img-ramdisk.img (the ramdisk I modified) and commented out these two lines in the updater-script:
    Code:
    #run_program("/tmp/dump_image", "boot", "/tmp/boot.img");
    #run_program("/tmp/unpackbootimg", "/tmp/boot.img", "/tmp/");
    As always, make a backup before attempting anything, and I take no responsibility for anything you break.

    I think my next mission will be attempting to relocate dalvik-cache to the /cache partition to make more room on /data
    EDIT: Changed my mind. Moving dalvik is probably a bad idea. The cache currently takes up about 80mb for 90mb of apps. Moving dalvik-cache to a cache partition that only has 90mb of space means that I'll have a ton more space on /data for apps, but I won't be able to use it, because the cache will be full.
    Last edited by Se7enLC; 06-21-2010 at 01:59 PM.
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  4. Senior Droid
    bad4u's Avatar
    Member #
    8302
    Join Date
    Nov 2009
    Posts
    226
    Phone
    moto droid
    #24
    I read that wiki how-to. Yeah, at first glance I understand maybe 50%....
    Themed swypes and stock keybrd for DX .. http://tinyurl.com/22q7mh2
  5. Junior Droid
    Cosmo24's Avatar
    Member #
    74589
    Join Date
    Jun 2010
    Posts
    29
    Phone
    Motorola Droid
    #25
    Okay i get mabey 35% of what im reading lol ...I would like to make the volume key up turn my phone on when its sleeping...and use it as power up button too....the reason is because my power button is starting to stick...and its hard sometimes to actually get it to turn on from sleep mode...for now im just sliding open the keyboard and that works..but its a pain.....can someone point me in the right direction..or will this require too much for a noob like me to do lol...thanks
  6. Droid Ninja
    Se7enLC's Avatar
    Member #
    5148
    Join Date
    Nov 2009
    Posts
    1,263
    Liked
    6 times
    Phone
    Samsung Galaxy Nexus
    #26
    Quote Originally Posted by Cosmo24 View Post
    Okay i get mabey 35% of what im reading lol ...I would like to make the volume key up turn my phone on when its sleeping...and use it as power up button too....the reason is because my power button is starting to stick...and its hard sometimes to actually get it to turn on from sleep mode...for now im just sliding open the keyboard and that works..but its a pain.....can someone point me in the right direction..or will this require too much for a noob like me to do lol...thanks
    In short, yeah, it's too much for a noob :-P

    I've tried it, using some helpful instructions I found on xda for an HTC device, but was not able to get it to work. That's an excellent use of this ability, though, once somebody figures out how.
    Cool CM Tricks
    custom_backup_list.txt - make a list of files in /system that will survive a nightly install (ringtones, notifications, system apps, wallpapers, whatever)
    in Terminal Emulator, set this as your shell command: "/system/xbin/su -c /system/xbin/bash". You get all the features of bash, root access, and you can still use the initial command field for whatever you want (default is adding /data/local/bin to your path)
  7. Junior Droid
    Jarvisoid's Avatar
    Member #
    67420
    Join Date
    May 2010
    Posts
    26
    Phone
    Droid
    #27
    Quote Originally Posted by ashkev843 View Post
    Can someone write one. To use the volume up and down to skip tracks on the music player when long pressed.
    THAT would be amazing!
    OG Droid - Project Ellite 5.0.2 - Honeycomb Theme
Page 3 of 3 FirstFirst 1 2 3

Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Similar Threads

  1. Help with writing a script
    By RichStevenson in forum Droid Development
    Replies: 2
    Last Post: 06-17-2010, 12:40 PM
  2. bb_improve - another script by me
    By Se7enLC in forum Bugless
    Replies: 3
    Last Post: 06-16-2010, 10:52 AM
  3. Script
    By ashin001 in forum Bugless
    Replies: 7
    Last Post: 05-27-2010, 05:06 PM
  4. Enableing script
    By Chris1980 in forum Hacking Help
    Replies: 0
    Last Post: 05-15-2010, 03:52 PM

Search tags for this page

android hard key run script
,

android init keycodes

,
android scripts for key pad
,

android wake dropped

,
desire init.rc keycodes pete
,
droid key 107
,
init.rc android keycodes
,

init.rc keycodes

,

key 399 grave

,
keycode android &init.rc
,
keycodes 107 android
,

options pete init.sholes

,
qwerty.kl android
,
run script hard key droid 2
,
wake dropped android
Click on a term to search our site for related topics.
Find us on Google+