[Q] switching tracks in the player the volume keys - Android Software/Hacking General [Developers Only]

Hi all!
Recently I was asked how to appoint a long press the volume buttons switching tracks in the music player. Something I have even happened,but it's not quite what I wanted to do. and so.
We go on the way /system/usr/keylayout/a4-gpio-keypad.kl and open this file with a text editor. on my phone it looks like this(you may vary)
Code:
key 399 GRAVE
key 2 1 WAKE_DROPPED
key 3 2 WAKE_DROPPED
key 4 3 WAKE_DROPPED
key 5 4 WAKE_DROPPED
key 6 5 WAKE_DROPPED
key 7 6 WAKE_DROPPED
key 8 7 WAKE_DROPPED
key 9 8 WAKE_DROPPED
key 10 9 WAKE_DROPPED
key 11 0 WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 230 SOFT_RIGHT WAKE
key 60 SOFT_RIGHT WAKE
key 107 ENDCALL WAKE_DROPPED
key 62 ENDCALL WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 59 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 127 SEARCH WAKE_DROPPED
key 228 POUND WAKE_DROPPED
key 227 STAR
key 231 CALL WAKE_DROPPED
key 61 CALL WAKE_DROPPED
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
key 102 HOME WAKE
key 105 DPAD_LEFT WAKE_DROPPED
key 106 DPAD_RIGHT WAKE_DROPPED
key 115 [COLOR="Red"]VOLUME_UP WAKE
key 114 VOLUME_DOWN[/COLOR] WAKE
key 116 POWER WAKE
key 211 FOCUS
key 212 CAMERA
key 16 Q WAKE_DROPPED
key 17 W WAKE_DROPPED
key 18 E WAKE_DROPPED
key 19 R WAKE_DROPPED
key 20 T WAKE_DROPPED
key 21 Y WAKE_DROPPED
key 22 U WAKE_DROPPED
key 23 I WAKE_DROPPED
key 24 O WAKE_DROPPED
key 25 P WAKE_DROPPED
key 26 LEFT_BRACKET WAKE_DROPPED
key 27 RIGHT_BRACKET WAKE_DROPPED
key 43 BACKSLASH WAKE_DROPPED
key 30 A WAKE_DROPPED
key 31 S WAKE_DROPPED
key 32 D WAKE_DROPPED
key 33 F WAKE_DROPPED
key 34 G WAKE_DROPPED
key 35 H WAKE_DROPPED
key 36 J WAKE_DROPPED
key 37 K WAKE_DROPPED
key 38 L WAKE_DROPPED
key 39 SEMICOLON WAKE_DROPPED
key 40 APOSTROPHE WAKE_DROPPED
key 14 DEL WAKE_DROPPED
key 44 Z WAKE_DROPPED
key 45 X WAKE_DROPPED
key 46 C WAKE_DROPPED
key 47 V WAKE_DROPPED
key 48 B WAKE_DROPPED
key 49 N WAKE_DROPPED
key 50 M WAKE_DROPPED
key 51 COMMA WAKE_DROPPED
key 52 PERIOD WAKE_DROPPED
key 53 SLASH WAKE_DROPPED
key 28 ENTER WAKE_DROPPED
key 56 ALT_LEFT WAKE
key 100 ALT_RIGHT WAKE
key 42 SHIFT_LEFT WAKE
key 54 SHIFT_RIGHT WAKE
key 15 TAB WAKE_DROPPED
key 57 SPACE WAKE_DROPPED
key 150 EXPLORER
key 155 ENVELOPE
key 12 MINUS WAKE_DROPPED
key 13 EQUALS WAKE_DROPPED
key 215 AT WAKE_DROPPED
change the fact that highlighted in red on the MEDIA_NEXT and MEDIA_PREVIOUS,saved.....
Now for a short press of the volume we will have to switch tracks in the player.
But that's not what I wanted to do. as I said,in this file does not set the values of action for a long pressed for example the menu button,or home. please help,I have looked everywhere but found nothing on how to assign a long press of the volume switch tracks?

Good work, and good luck in the future

Related

[TUT] Change wakeup buttons

Challenge: don't wake up you phone when I press any of the buttons!!! Only ENDCALL button (example is from Samsung i5500 with Froyo)
Finding the keycode for a button
Click all the hardware buttons (write down the sequence you pushed
Find keycode with dmesg (rooted phone)
# dmesg|grep keycode:
dmesg|grep keycode:
<4>[ 6379.122037] key event (keycode:107, pressed:1), wlan_debug_step=0
<4>[ 6379.304589] key event (keycode:107, pressed:0), wlan_debug_step=0
<4>[ 6400.249157] key event (keycode:139, pressed:1), wlan_debug_step=0
<4>[ 6400.451860] key event (keycode:139, pressed:0), wlan_debug_step=0
<4>[ 6404.388724] key event (keycode:102, pressed:1), wlan_debug_step=0
<4>[ 6404.571092] key event (keycode:102, pressed:0), wlan_debug_step=0
<4>[ 6407.086125] key event (keycode:158, pressed:1), wlan_debug_step=0
<4>[ 6407.268522] key event (keycode:158, pressed:0), wlan_debug_step=0
<4>[ 6410.270504] key event (keycode:217, pressed:1), wlan_debug_step=0
<4>[ 6410.432657] key event (keycode:217, pressed:0), wlan_debug_step=0
<4>[ 6422.337047] key event (keycode:103, pressed:1), wlan_debug_step=0
<4>[ 6422.580344] key event (keycode:103, pressed:0), wlan_debug_step=0
<4>[ 6425.833795] key event (keycode:105, pressed:1), wlan_debug_step=0
<4>[ 6426.036509] key event (keycode:105, pressed:0), wlan_debug_step=0
<4>[ 6429.794280] key event (keycode:108, pressed:1), wlan_debug_step=0
<4>[ 6429.997194] key event (keycode:108, pressed:0), wlan_debug_step=0
<4>[ 6433.061290] key event (keycode:106, pressed:1), wlan_debug_step=0
<4>[ 6433.304629] key event (keycode:106, pressed:0), wlan_debug_step=0
<4>[ 6437.635529] key event (keycode:231, pressed:1), wlan_debug_step=0
<4>[ 6437.797985] key event (keycode:231, pressed:0), wlan_debug_step=0
<4>[ 6442.918039] key event (keycode:107, pressed:1), wlan_debug_step=0
<4>[ 6443.141397] key event (keycode:107, pressed:0), wlan_debug_step=0
So for Samsung i5500 the scan / keycode table looks like:
139 MENU
102 HOME
158 BACK
217 SEARCH
103 DPAD_UP
105 DPAD_UP
108 DPAD_DOWN
106 DPAD_RIGHT
232 DPAD_CENTER
231 CALL
107 ENDCALL
114 VOLUME_DOWN
115 VOLUME_UP
Which button definition file is in use
In a adb shell type: getprop hw.keyboards.0.devname
In my case it is europa_keypad0
cd /system/usr/keylayout
ls -l
-rw-r--r-- root root 349 2011-04-01 13:01 AVRCP.kl
-rw-r--r-- root root 1712 2011-04-01 13:01 europa_keypad0.kl
-rw-r--r-- root root 1697 2011-04-01 13:01 europa_headset.kl
-rw-r--r-- root root 1699 2011-04-01 13:01 qwerty.kl
This file looks like:
key 158 BACK WAKE_DROPPED <<<REMOVE
key 230 SOFT_RIGHT WAKE
key 60 SOFT_RIGHT WAKE
key 107 ENDCALL WAKE_DROPPED <<<REMOVE
WAKE: When this key is pressed while the device is asleep, the device will wake up and the key event gets sent to the app.
WAKE_DROPPED: When this key is pressed while the device is asleep, the device will wake up and the key event does not get sent to the app.
So:
- system needs to be r/w mounted
- adb pull /system/usr/keylayout/europa_keypad0.kl
- adb shell chmod 666 /system/usr/keylayout/europa_keypad0.kl
- edit you file, remove any WAKE or WAKE_DROPPED from the keys
that you don't want the phone to wake up
(or do the opposite if you like your phone to wake on a specific button)
- adb push europa_keypad0.kl /system/usr/keylayout
- reboot
Cheers
ORG:
Code:
key 399 GRAVE
key 2 1
key 3 2
key 4 3
key 5 4
key 6 5
key 7 6
key 8 7
key 9 8
key 10 9
key 11 0
key 158 BACK WAKE_DROPPED
key 230 SOFT_RIGHT WAKE
key 60 SOFT_RIGHT WAKE
key 107 ENDCALL WAKE_DROPPED
key 62 ENDCALL WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 59 MENU WAKE_DROPPED
key 127 SEARCH WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 228 POUND
key 227 STAR
key 231 CALL WAKE_DROPPED
key 61 CALL WAKE_DROPPED
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
key 102 HOME WAKE
key 105 DPAD_LEFT WAKE_DROPPED
key 106 DPAD_RIGHT WAKE_DROPPED
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 116 POWER WAKE
key 212 CAMERA
MOD:
Code:
key 399 GRAVE
key 2 1
key 3 2
key 4 3
key 5 4
key 6 5
key 7 6
key 8 7
key 9 8
key 10 9
key 11 0
key 158 BACK
key 230 SOFT_RIGHT
key 60 SOFT_RIGHT
key 107 ENDCALL WAKE_DROPPED
key 62 ENDCALL WAKE_DROPPED
key 229 MENU
key 139 MENU
key 59 MENU
key 127 SEARCH
key 217 SEARCH
key 228 POUND
key 227 STAR
key 231 CALL
key 61 CALL
key 232 DPAD_CENTER
key 108 DPAD_DOWN
key 103 DPAD_UP
key 102 HOME
key 105 DPAD_LEFT
key 106 DPAD_RIGHT
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 116 POWER
key 212 CAMERA

Creative Ziio 10" Home Button dnot work after root

I rooted my Ziio" yesterday.
Installed Google apps.
Have some problems with SetupWizard.apk.
First time after restart work setupwizard i configured my google acc etc. , but after other restart hang on start screen where i must push the android in middle of screen to start, but after do it nothing happens. And homebutton not work , but after i deletet it with adb my Tablet work. Google MArket, Gmail. maps works.
MY Creative Ziio 10, heve 7 Hardware buttons under Display.
All of them work, only my Home button dnot work.
Normyly if i hold Home Button started Taskmanager, or if i press it i go back to desktop.
i have in /system/usr/keylayout/ 4 Files.
ACRPC.kl, qwerty.kl, Touchscreen,kl, wm8350_buttons.kl
But i dnot know where is for my home button.
Maybe blocking some App this button.
Other guy where rootes his ziio 10" , have same problem like me...
Any Ideeas ? how to fix it
I try to Edit Touchscreen.kl for Test.
I Set Homebutton @ 165
And Menu @ 163.
Menu works on new button but home still dnot work.
I think maybe google setup disabled the home funktion.
here a little cu on my touchscreen.kl
key 108 CALL WAKE_DROPPED
#key 103 CALL WAKE_DROPPED stargate rev0
key 139 MENU WAKE_DROPPED
key 103 ENDCALL WAKE_DROPPED
#key 108 ENDCALL WAKE_DROPPED stargate rev0
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 102 HOME WAKE
key 158 BACK WAKE_DROPPED
key 216 BACK WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 164 MEDIA_PLAY_PAUSE WAKE
key 201 MEDIA_PLAY_PAUSE WAKE
key 163 TOUCH_NEXT WAKE
key 165 TOUCH_PREVIOUS WAKE
key 212 CAMERA WAKE
key 116 POWER WAKE
Click to expand...
Click to collapse
Plz any one help me.
How did you obtain permanent root? I've gotten almost as far as you have but I've had to reset my tablet after the first or second reboot after rooting.
Thanks!
I dont know if it would be of help.... I have a Ziio 7
Rooted it - and the menu/homescreen would not work....tried lots of work around nothing happened (deleting the google accounts etc..etc..)
Finally i did a factory reset....
my google applications stayed (market, gmail etc...)
Rooted again.. and now everything works....

[HOWTO] Fixing ghost-hardkeys

Apparently there are quite a few people having trouble with the hard keys (Menu, Home, Back, Search) becoming possessed, and pressing themselves at inopportune moments. For me it was the back key. Now on to the fixing.
First, the obvious. Root the phone, put it in debug (Settings>Applications>Development), and plug it into a computer with adb.
1) # adb pull /system/usr/keylayout/melfas_touchkey.kl key.kl
2) Open key.kl in wordpad, or nano, or vim. Hell, break out a hex editor if you want, just keep in mind notepad messes up the formatting. It'll look as such, though the numbers will probably differ.
key 139 MENU WAKE_DROPPED
key 102 HOME WAKE_DROPPED
key 158 BACK WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
key 105 DPAD_LEFT WAKE_DROPPED
key 106 DPAD_RIGHT WAKE_DROPPED
key 231 SEND WAKE_DROPPED
key 212 CAMERA WAKE_DROPPED
3) Because the 'Back' key (158) is pressing itself, and the 'Search' key (217) is basically unnecessary, we're gonna switch 'em, and render the 'Back' key (158) inoperable. Ex:
key 139 MENU WAKE_DROPPED
key 102 HOME WAKE_DROPPED
key 217 BACK WAKE_DROPPED
#key 217 SEARCH WAKE_DROPPED
Basically, replace the keycode of the faulty button (158) with the keycode of the Search button (217), then comment out the Search line (s'what the '#' is for).
So if it was your Home key, you would have replaced 102 with 217.
Sidenote: If it's your search key pressing itself, just comment out the Search line.
Now save the file.
4) # adb push key.kl /sdcard/key.kl
5) # adb shell
6) # su
7) type mount and find the line what looks like this:
/dev/block/stl9 /system ext4 ro,relatime,barrier=0,data=writeback,noauto_da_allo
c 0 0
we need /system to be writable, so issue the following command
# mount -o rw,remount /dev/block/(whatever it is for you) /system/
8) # cat /sdcard/key.kl > /system/usr/keylayout/melfas_touchkey.kl
Now just exit outta adb, reboot your phone, and you're done. Just press the search key instead of the back key (Or whichever was being rebellious).
P.S. If you end up really missing your Search key, I recommend the app "button savior".
great how to, saved me a trip to the samsung store.
Great post
Great post. my seach key is constantly pressing itself. do you think this file could be pulled with Root explorer, edited via the PC and then copied back via root explorer? I am not that good with ADB and command such.
Why yes pickupman66... this can be edited directly with root explorer. Make sure u mount the folder r/w then long press on the file and open in text editor. Reboot and no more ghost key.

Power button broken

Hi all,
I dropped the phone and broke the power button. I solved remapping the key with another that doesn't use much, and it works the problem there's when the cell goes into sleep mode because the current don't pass in keyboard, my question is: can I change the sleep mode and give current at one button or at kayboard and leaving everything else unchanged
someone could help me thanks a lot!
I'm not sure how it is setup on your device, but on mine there are two classes of buttons.
Most buttons are on the TWL4030 peripheral which uses a scanning matrix.
A few buttons are on the GPIO lines directly on the OMAP3621 processor.
Scanning is shut off in sleep mode, so scanned buttons won't work then.
The GPIO buttons can generate an interrupt and will work in sleep mode.
Since you know already how to remap keys, just look at /system/usr/keylayout and find what your options are.
the original situation in system\usr\keylayout is:
key 399 GRAVE
key 2 1
key 3 2
key 4 3
key 5 4
key 6 5
key 7 6
key 8 7
key 9 8
key 10 9
key 11 0
key 158 BACK WAKE_DROPPED
key 230 SOFT_RIGHT WAKE
key 60 SOFT_RIGHT WAKE
key 107 ENDCALL WAKE_DROPPED
key 62 ENDCALL WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 59 MENU WAKE_DROPPED
key 127 SEARCH WAKE_DROPPED
key 217 SEARCH WAKE_DROPPED
key 228 POUND
key 227 STAR
key 231 CALL WAKE_DROPPED
key 61 CALL WAKE_DROPPED
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
key 102 HOME WAKE
key 105 DPAD_LEFT WAKE_DROPPED
key 106 DPAD_RIGHT WAKE_DROPPED
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 116 POWER WAKE
key 212 CAMERA
key 16 Q
key 17 W
key 18 E
key 19 R
key 20 T
key 21 Y
key 22 U
key 23 I
key 24 O
key 25 P
key 26 LEFT_BRACKET
key 27 RIGHT_BRACKET
key 43 BACKSLASH
key 30 A
key 31 S
key 32 D
key 33 F
key 34 G
key 35 H
key 36 J
key 37 K
key 38 L
key 39 SEMICOLON
key 40 APOSTROPHE
key 14 DEL
key 44 Z
key 45 X
key 46 C
key 47 V
key 48 B
key 49 N
key 50 M
key 51 COMMA
key 52 PERIOD
key 53 SLASH
key 28 ENTER
key 56 ALT_LEFT
key 100 ALT_RIGHT
key 42 SHIFT_LEFT
key 54 SHIFT_RIGHT
key 15 TAB
key 57 SPACE
key 150 EXPLORER
key 155 ENVELOPE
key 12 MINUS
key 13 EQUALS
key 215 AT
# On an AT keyboard: ESC, F10
key 1 BACK WAKE_DROPPED
key 68 MENU WAKE_DROPPED
I changed key 127 SEARCH WAKE_DROPPED
in key 127 POWER WAKE
it's all ok?
What else should I change?
there's someone that help me?

[Q] need help with hard key remapping

My device LG optimus P500, ICS 4.0.4. I've made my hard button "search" to open dialer, but there is problem how to make this button to open "voice search" service via long press. Now if it long pressed - opens "voice dialer" service, but I want voice search, here i a part of my file thunder_keypad.kl:
key 158 BACK WAKE_DROPPED
key 230 HOME WAKE
key 60 SOFT_RIGHT WAKE
key 62 ENDCALL WAKE_DROPPED
key 229 MENU WAKE_DROPPED
key 59 MENU WAKE_DROPPED
key 139 MENU WAKE_DROPPED
key 228 POUND
key 227 STAR
key 231 CALL WAKE_DROPPED
key 61 CALL WAKE_DROPPED
key 232 DPAD_CENTER WAKE_DROPPED
key 108 DPAD_DOWN WAKE_DROPPED
key 103 DPAD_UP WAKE_DROPPED
#key 102 ENDCALL WAKE_DROPPED
key 102 HOME WAKE
key 105 DPAD_LEFT WAKE_DROPPED
key 106 DPAD_RIGHT WAKE_DROPPED
key 115 VOLUME_UP WAKE
key 114 VOLUME_DOWN WAKE
key 213 DEL WAKE_DROPPED
key 355 DEL WAKE_DROPPED
key 212 CAMERA
key 247 FOCUS
key 217 CALL WAKE_DROPPED

Categories

Resources