The Asus Cube (image from Amazon.com) |
I won't go into great detail about getting root on this device here, you can find that yourself. Root is however required to proceed.
Look for this file: /system/usr/keylayout/Vendor_0b05_Product_17ca.kl.
The /system filesystem must be mounted with read/write access. You can do this from adb or the awesome ES File Explorer is able to do this.
Change the following lines:
key 87 KEYCODE_VOICE_SEARCH
key 88 KEYCODE_NETFLIX
change to:
# key 87 KEYCODE_VOICE_SEARCH
# key 88 KEYCODE_NETFLIX
key 88 TV_POWER
Reboot the device completely, a good way to do this is by issuing "adb reboot". Another way is to disconnect the power to the device.
Now you can stop accidentally hitting the voice search key and have a "sort of" working TV power key. The reason I say this is because the IR blaster is required, so the newly-added TV_POWER button will not work unless you have the Cube powered up already.
If you don't want to change the Netflix key, you could, for example, change the existing TV/STB key to be TV_POWER. I am not at the moment a Netflix subscriber so this key is useless to me.
This worked great, thanks! Only thing is I want to change the red power button at the top right of the remote that sends the cube to whichever standby mode you select in settings to simply be TV_POWER. I've tried changing key 116 in both Vendor_0b05_Product_17ca.kl and Vendor_0058_Product_2000.kl but haven't had any success. Do you know which key I should remap?
ReplyDeleteHi shunjou, unfortunately I don't think so. I think that red power button actually sends an IR command to the box that is dealt with at a lower level than the key handler... At least that is my suspicion, since the red key works to turn the box on even when the Cube is OFF (i.e. Android not even running yet). I tried to capture the power key "key event" but -- I didn't get a key event from it.
DeleteSo unfortunately I think what you want to do could be done, but probably not as easily as changing this file. That is just my hunch...
I just changed key 243 to TV_POWER and that works perfect for me. Why not use that one instead?
Deletekey 243 STB_POWER
DeleteSure, you can remap whatever you like. I wanted to have the ability to turn off the set top box still so that is why I didn't use that one. I complained about NOT having this button on my Sony so I figured I'd better leave it alone now that I have it. :-)
Where can I find more keycodes? I want to remap a key to switch hdmi inputs on tv. I know its possible because able remote can do this...just need the right command.
DeleteMight be this one. http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_TV_INPUT
Delete