Introduction
This document describes a workaround that allows the keys that are normally forwarded to H200 OS directly, to be remapped to other Android/browser key events, making it possible for these keys to be used for other purposes.
Prerequisites
None
Summary
Steps
In summary, we will be remapping the keys as described in the table below. Values in brackets are standard Android key event values.
(see https://developer.android.com/reference/android/view/KeyEvent for reference)
OAK remote key | Original Android key event (value) | Target Android key event (value) |
STB Power key | KEYCODE_POWER (26) | KEYCODE_TV_POWER (177) |
Vol+ | KEYCODE_VOLUME_UP (24) | KEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP (253) |
Vol - | KEYCODE_VOLUME_DOWN (25) | KEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN (254) |
MUTE | KEYCODE_VOLUME_MUTE (164) | KEYCODE_TV_AUDIO_DESCRIPTION (252) |
1. To remap all of the keys in the table, we will add the following ini option for the STB.
keycode.remap.generic="26=177 24=253 25=254 164=252"
2. Reboot the STB with the new configuration.
3. Observe that the target key event would be triggered if the respective OAK remote key was pressed.
e.g. Use adb to connect to the STB and check the logcat output
When STB power key is pressed:
09-29 07:30:41.751 3937 4021 V WindowManager: start: cks.size() = 2 ck.key = 177 ck.time = 1664436641751
09-29 07:30:42.154 3937 4021 I InputReader: Amino: remap keycode: 177
When Vol + key is pressed:
09-29 07:30:00.945 3937 4021 V WindowManager: start: cks.size() = 4 ck.key = 253 ck.time = 1664436600945
09-29 07:30:01.134 3937 4021 I InputReader: Amino: remap keycode: 253
When Vol - is pressed:
09-29 07:36:19.253 3937 4021 V WindowManager: start: cks.size() = 3 ck.key = 254 ck.time = 1664436979253
09-29 07:36:19.550 3937 4021 I InputReader: Amino: remap keycode: 254
When Mute is pressed:
10-26 17:58:34.870 3822 3907 V WindowManager: start: cks.size() = 5 ck.key = 252 ck.time = 1666778314870
10-26 17:58:35.163 3822 3907 I InputReader: Amino: remap keycode: 252
References
None