Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

[HOWTO][M8Pro] Remap ESC and MENU hardkeys for volume control

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [HOWTO][M8Pro] Remap ESC and MENU hardkeys for volume control

    I've always found it annoying that Pipo mapped the "volume rocker" for ESC/back and Menu. I wanted them to function as a volume rocker. So after a bit of research, followed by some trial and error; Here's how you do it!

    -
    [YOU DO THIS AT YOUR OWN RISK. NEITHER I NOR FREAKTAB.COM WILL ASSUME ANY RESPONSIBILITY IF IT DOESN'T WORK OUT]

    You will need Root permissions to do this. If you don't have root, search the forum for instructions or flash a Pre-rooted ROM. You will also need a file explorer with root capabilities. Personally I prefer Root Explorer, so instructions are biased towards this - but it doesn't take much brainpower to apply them accordingly, using another file explorer and/or editing the file on your computer.

    Additionally - I suggest you get an "extended text/code editor". Its not complicated to use unless you need it to be, but it makes this type of thing much easier, as it recognizes file structure and different code - and applies color-coding and good overview. I suggest Notepad++.

    So,
    • Open your explorer, got to /system/usr/keylayout
      Make a backup copy of rk29-keypad.kl - I suggest storing the backup on your external sd and make a copy to your computer.
    • At this point, you can either edit the file directly or do so on your computer. To do it straight on the device :
    • (In Root Explorer - browse to /system/usr/keylayout) - press "Mount R/W" near the top. Now long-press on the original rk29-keypad.kl - select "Open in Text Editor".
    • Here you need to edit the button function. Key 59 is Menu (left side rocker), Key 158 is ESC/Back (right side rocker)
    • Change value for key 59 from MENU to VOLUME_DOWN . Change value for key 158 from BACK to VOLUME_UP .
    • Press menu button in upper right corner, Save and Exit.
    • Long-press rk29-keypad.kl , select Permissions. Make sure they are rw-r--r-- / 644 / Read: All - Write: Owner.
    • Click "Mount R/O" near the top.
    • Exit the browser and reboot / power on & off your tablet.
    Enjoy your Volume rocker!

    The change is reversible by restoring your backup and setting permissions again, or perform the same steps, but changing the values of the keys back again to its original values.
    -

    Notes: This could work on other tablets/phones - but it will probably need an adaptation to fit your tablet/phone. Download KeyTest (link), run it. Push your hardkey, look for scanCode=xxx in the output. This is the raw hardware id of that key.

    Other phones/tablets might very well have this key mapping in another file. Copy your /system/usr/keylayout folder to your computer, and search the folder for files containing the text key ### - where ### is the number value from scanCode above. Adapt the instructions above for your change.

    A module-specific file (like rk29-keypad.kl) will override the generic.kl file. If you find your key entry in multiple .kl files, read the top portion of the file so you know what the layout is for - before you make any changes.

    NOTE: This should not affect the way the buttons work with boot and flashing procedures, navigating recovery etc. These Keymappings only takes effect once Android is loaded.
    Last edited by pr0xZen; 07-09-2013, 06:19.
    Support your local flasher
    Current devices : Pipo MAX M8 Pro - Samsung Galaxy S4 - Intel NUC

    #2
    Re: [HOWTO][M8Pro] Remap ESC and MENU hardkeys for volume control

    Originally posted by pr0xZen View Post
    I've always found it annoying that Pipo mapped the "volume rocker" for ESC/back and Menu. I wanted them to function as a volume rocker. So after a bit of research, followed by some trial and error; Here's how you do it!

    -
    [YOU DO THIS AT YOUR OWN RISK. NEITHER I NOR FREAKTAB.COM WILL ASSUME ANY RESPONSIBILITY IF IT DOESN'T WORK OUT]

    You will need Root permissions to do this. If you don't have root, search the forum for instructions or flash a Pre-rooted ROM. You will also need a file explorer with root capabilities. Personally I prefer Root Explorer, so instructions are biased towards this - but it doesn't take much brainpower to apply them accordingly, using another file explorer and/or editing the file on your computer.

    Additionally - I suggest you get an "extended text/code editor". Its not complicated to use unless you need it to be, but it makes this type of thing much easier, as it recognizes file structure and different code - and applies color-coding and good overview. I suggest Notepad++.

    So,
    • Open your explorer, got to /system/usr/keylayout
      Make a backup copy of rk29-keypad.kl - I suggest storing the backup on your external sd and make a copy to your computer.
    • At this point, you can either edit the file directly or do so on your computer. To do it straight on the device :
    • (In Root Explorer - browse to /system/usr/keylayout) - press "Mount R/W" near the top. Now long-press on the original rk29-keypad.kl - select "Open in Text Editor".
    • Here you need to edit the button function. Key 59 is Menu (left side rocker), Key 158 is ESC/Back (right side rocker)
    • Change value for key 59 from MENU to VOLUME_DOWN . Change value for key 158 from BACK to VOLUME_UP .
    • Press menu button in upper right corner, Save and Exit.
    • Long-press rk29-keypad.kl , select Permissions. Make sure they are rw-r--r-- / 644 / Read: All - Write: Owner.
    • Click "Mount R/O" near the top.
    • Exit the browser and reboot / power on & off your tablet.
    Enjoy your Volume rocker!

    -

    Notes: This could work on other tablets/phones - but it will probably need an adaptation to fit your tablet/phone. Download KeyTest (link), run it. Push your hardkey, look for scanCode=xxx in the output. This is the raw hardware id of that key.

    Other phones/tablets might very well have this key mapping in another file. Copy your /system/usr/keylayout folder to your computer, and search the folder for files containing the text key ### - where ### is the number value from scanCode above. Adapt the instructions above for your change.

    A module-specific file (like rk29-keypad.kl) will override the generic.kl file. If you find your key entry in multiple .kl files, read the top portion of the file so you know what the layout is for - before you make any changes.
    Great finds thanks for shearing



    Sent from my Tablet using Tapatalk 2

    Comment


      #3
      Great work, prOxZen!!!!

      I'm assuming that this remapping happens after the system is loaded, so it won't have an affect on how to manually get into flash mode??????
      Randy
      Freaktab Developer, Product Reviewer, Moderator and "Flashaholic".
      Read my BIO Here
      Be sure to donate to support Freaktab.com. If any of my development work makes a positive difference for you, please make a donation to support future RileyROM's.
      Donate here

      Comment


        #4
        Originally posted by rrileypm View Post
        Great work, prOxZen!!!!

        I'm assuming that this remapping happens after the system is loaded, so it won't have an affect on how to manually get into flash mode??????
        Indeed. My reset button is still wonky, so don't know about that - but I had no problem booting to CWM with "VOLUME_UP + POWER" - or navigating/operating CWM. Recovery boot and other boot "hard-key procedures" listens to the same raw key id's, and do their own thing. As indicated - none of these key mappings have any effect before Android is up & running.
        Support your local flasher
        Current devices : Pipo MAX M8 Pro - Samsung Galaxy S4 - Intel NUC

        Comment


          #5
          I wanted to don this. But howndo you wake up from sleep?

          Comment


            #6
            Originally posted by reezer View Post
            I wanted to don this. But howndo you wake up from sleep?
            If you look in the rk29-keypad.kl file, you'll see that Key 116 has a WAKE function following it. Replicate that for your Key 59 and Key 158. You'll still have to to the same procedures with Mounting R/W, R/O, and setting the permissions afterwards - unless you do all the changes at one time. And reboot, ofcourse.
            Support your local flasher
            Current devices : Pipo MAX M8 Pro - Samsung Galaxy S4 - Intel NUC

            Comment


              #7
              Could people with M9 / M8 (non-pro) / M6 etc (basicly all current-range Pipo tablet with "MENU/ESC" volume rockers - do me a big favour?

              Zip up your /system/usr/keylayout folder, install KeyTest (link) and check the scanCode=### value for their "menu/esc" (left/right) buttons (remember to note which one is what) - and post me your result.

              I've got a little project in the works - and its quite possible this could work without major adjustments - for all the current Pipo tablets, nut just the M8pro.
              Support your local flasher
              Current devices : Pipo MAX M8 Pro - Samsung Galaxy S4 - Intel NUC

              Comment


                #8
                Going to try this..for sure.

                Does it remove the volume controls from the task bar. If not, is there a way?

                Thanks
                Cube T9; Pipo M8 Pro (on life support); LG gPad

                Comment


                  #9
                  Re: [HOWTO][M8Pro] Remap ESC and MENU hardkeys for volume control

                  No, it just does what it says on the tin - remap the function of the keys (when in android that is). I've been looking to change the soft keys, too, as you'll loose the "menu" button with this procedure (there isn't one on the softkey bar). I'd love to add it there, although I haven't figured it out yet.
                  If you figure out how to change it, let me know.
                  Support your local flasher
                  Current devices : Pipo MAX M8 Pro - Samsung Galaxy S4 - Intel NUC

                  Comment

                  Working...
                  X