Swap hardware (capacitive) buttons. - OnePlus X Q&A, Help & Troubleshooting

Hi,
can anyone tell me how it is to be done on Oneplus X with CM 12.1.
I am able to configure Menu and Home buttons via settings, but I cannot swap location or configure Back button.
Editing Generic.kl did not work, I think it might be overridden by the cyanogen mod settings?
thanks
freaksworth

Related

[Q] Mapping volume keys to HOME, BACK and possibly more

My HD2 "Frankenphone" (it's built from no less than 3 other HD2's) has no working hardware keys on the front of the phone. The volume keys, however, do still work. I therefore want to cook a rom based on an existing one that has Volume up/down mapped to HOME/Back.
Furthermore, I was wondering if I could somehow get the MENU button implemented as well. I understand that this is not possible through the SDK, but perhaps it can be done by writing native C code. E.g. a longpress Volume-up could be menu, a long-press Volume-down could be search.
I'm not asking for someone to do this for me, I'd like to do this myself. What I'm looking for are a few quick pointers to how to start this endeavor. I have previous experience cooking custom roms using toolchains under linux, and also experience writing C (non-gui) code under linux. So useful pointers would be :
* Where can I find the key mappings? I suppose this is part of the kernel/user space?
* How would I go about implementing the long-press feature? Or can you hint towards another possible solution that does not involve the front hardware keys (touchscreen snooping for gestures? accellerometer? Any other sensor?)
Take a look here:
http://source.android.com/porting/keymaps_keyboard_input.html
Hope that helps.
One thing I do in most builds is change my call key to a search key.
Hi!
Take a look at the following thread! http://forum.xda-developers.com/showthread.php?t=740629
paalkr said:
Hi!
Take a look at the following thread! http://forum.xda-developers.com/showthread.php?t=740629
Click to expand...
Click to collapse
Awesome, thanks! That worked like a charm. Mounted the system.ext2 loopback, patched the keys, and tadaah, working home + back. That at least makes the phone usable again.
Can anyone recommend a solution to get a working MENU action? It looks like long-press back is handled by apps individually (e.g. in the browser it will show a history), while long-press home displays a task switcher. I could live with long-press back being handled by android itself to implement the menu function.
(edit) looks like this is possible, e.g. here it mentions "including some special features to support the virtual hard keys that are appearing on recent devices such as Droid." Now how did they do that?

paranoidandroid Show menu button on navbar

Anyway to add the menu button to the navbar when using tablet mode?
Looks like this is something that can be done by modifying systemui.apk
I was able to modify the home and back button as they had preexisting keycodes but what I really want todo is replace the recent apps button as this is something i never use. But adding keycode to that did not work and it retained its original function. Does anyone have any ideas or experience in this area?
was able to get it working heres a modified systemui.apk if anyone is interested.

[Q] Hide the virtual HOME softkey?

Is there a relatively easy way to permanently hide just the HOME virtual softkey on android JB? Or failing that, disable it? I have a GS3 on a MIUI 4.2.2 ROM (I dont want to change ROMs). I am referring to the virtual softkey on the touchscreen, not the capacitive key at the bottom of the phone. The phone already has a hard HOME key so I dont need the virtual one, which duplicates it. I know that "172" controls the hw HOME key, so I tried remming out "102" in every file I could find it in (keypad_8960.kl, Generic.kl, sec_key.kl, sec_touchkey.kl, cyttsp-i2c.kl). It had no effect on anything.
Cyanoid said:
Is there a relatively easy way to permanently hide just the HOME virtual softkey on android JB? Or failing that, disable it? I have a GS3 on a MIUI 4.2.2 ROM (I dont want to change ROMs). I am referring to the virtual softkey on the touchscreen, not the capacitive key at the bottom of the phone. The phone already has a hard HOME key so I dont need the virtual one, which duplicates it. I know that "172" controls the hw HOME key, so I tried remming out "102" in every file I could find it in (keypad_8960.kl, Generic.kl, sec_key.kl, sec_touchkey.kl, cyttsp-i2c.kl). It had no effect on anything.
Click to expand...
Click to collapse
you may get a better response if the same question is asked in the respective miui thread.
:good:

[Guide] Replace MENU with Recent Apps on CM12.1

This guide is for the Note 3 Neo and should work on all variants.
If you're looking at this thread then you should have noticed that the Menu key on @FireLord 's CM12.1 is mapped to MENU and you can't change it from Buttons in Settings since it only has Power Button, Recents Button, Volume Button and Home button and no Menu Button.
Of course, there are a bunch of Xposed Modules such as MenuBegone available to do the same but if you'd rather not install anything or if you just like to mess with your phone then this is the guide to follow
So here's what you to do make your Menu key function as a Recent's key.
Download any Root Brower (I'd suggest the one included in Rom Toolbox)
Navigate to /system/usr/keylayout/Generic.kl
Open the File Generic.kl as a text file
Look for key 139 MENU in the list
Replace MENU with APP_SWITCH
Save and Reboot
Now your Menu key will function as a Recents Key and you'll also be able to change what tapping it and long-pressing it does through Buttons In Settings.
Thanks for the info.
but do you know how to enable vibration on them?
damadikaz said:
Thanks for the info.
but do you know how to enable vibration on them?
Click to expand...
Click to collapse
Oh I'm sorry, I'm afraid i don't know about that. All the vibrations are on and it seems only the Soft keys aren't vibrating. I'll fill you in if i do find something out though.
ICUDeadNaw said:
Oh I'm sorry, I'm afraid i don't know about that. All the vibrations are on and it seems only the Soft keys aren't vibrating. I'll fill you in if i do find something out though.
Click to expand...
Click to collapse
I've found temporary solution tbh, but it kinda weird. the softkey also vibrate when the screen is off.
http://forum.xda-developers.com/showthread.php?t=2152355
still searching for another solution tho.

Change behavior of double-press power button?

I know there's a setting, but there are only two options offered: Nothing or Open Camera
I'd love to be able to toggle the flashlight with the power button. Anybody know where the system file is that controls that? Would it be in build.prop?
Now, I know what I'm going to say it's not the solution that you're looking for BUT, I remember that OnePlus X had a default behavior for when you draw a V (I assume it reassembles a light coming our from a flashlight), so I used the same on OP N10. This option is available at Settings > Buttons & Gestures > Quick Gestures > Draw V
You can change this in framework-res.apk and its affiliates, change the integer text and remove impeding files. Cheers

Categories

Resources