[Android TV General] joaopauloac:
Recently I purchased my new XMRM-19 remote control for my Mi Stick TV Android TV (ver.9). I tried to remap the "new" buttons, but in all of them I receive the code "UNKNOWN (0)" in any remapping application. It seems to me that the problem is with the Android TV system, since the buttons are recognized when I execute commands in ADB (see below).

Is there any way to program and link, through ADB, the pressing of a button to its respective code? Example:

By pressing the "Home" button, the system recognizes as:

KEYCODE_HOME = 3 (this one works)

By pressing the "7" button, the system recognizes as (this one does not work):

KEYCODE_7 = 14 instead of KEYCODE_UNKNOWN = 0

By pressing the "Channel up" button, the system recognizes it as (this one doesn't work):

KEYCODE_CHANNEL_UP = 166 instead of KEYCODE_UNKNOWN = 0

By pressing the "Red" button, the system recognizes as (this one doesn't work):

KEYCODE_PROG_RED = 183 instead of KEYCODE_UNKNOWN = 0

------------------------------------------------ADB------------------------------------------------

C:\>cd adb

C:\adb>adb shell

aquaman:/ $ getevent -l

add device 1: /dev/input/event3

name: "Xiaomi RC"

add device 2: /dev/input/event2

name: "virtual-search"

could not get driver version for /dev/input/mice, Not a typewriter

add device 3: /dev/input/event1

name: "cec_input"

could not get driver version for /dev/input/mouse0, Not a typewriter

add device 4: /dev/input/event0

name: "aml_keypad"

/dev/input/event3: EV_MSC MSC_SCAN 0007001e

/dev/input/event3: EV_KEY KEY_1 DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 0007001e

/dev/input/event3: EV_KEY KEY_1 UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c0060

/dev/input/event3: EV_KEY KEY_INFO DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c0060

/dev/input/event3: EV_KEY KEY_INFO UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00cf

/dev/input/event3: EV_KEY KEY_VOICECOMMAND DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00cf

/dev/input/event3: EV_KEY KEY_VOICECOMMAND UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c008e

/dev/input/event3: EV_KEY KEY_VIDEOPHONE DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c008e

/dev/input/event3: EV_KEY KEY_VIDEOPHONE UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00b0

/dev/input/event3: EV_KEY KEY_PLAY DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00b0

/dev/input/event3: EV_KEY KEY_PLAY UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c0196

/dev/input/event3: EV_KEY KEY_WWW DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c0196

/dev/input/event3: EV_KEY KEY_WWW UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c0094

/dev/input/event3: EV_KEY KEY_EXIT DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c0094

/dev/input/event3: EV_KEY KEY_EXIT UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00e2

/dev/input/event3: EV_KEY KEY_MUTE DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00e2

/dev/input/event3: EV_KEY KEY_MUTE UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00e9

/dev/input/event3: EV_KEY KEY_VOLUMEUP DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00e9

/dev/input/event3: EV_KEY KEY_VOLUMEUP UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00ea

/dev/input/event3: EV_KEY KEY_VOLUMEDOWN DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00ea

/dev/input/event3: EV_KEY KEY_VOLUMEDOWN UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00b7

/dev/input/event3: EV_KEY KEY_STOPCD DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00b7

/dev/input/event3: EV_KEY KEY_STOPCD UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00b8

/dev/input/event3: EV_KEY KEY_EJECTCD DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00b8

/dev/input/event3: EV_KEY KEY_EJECTCD UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00b9

/dev/input/event3: EV_KEY KEY_SHUFFLE DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c00b9

/dev/input/event3: EV_KEY KEY_SHUFFLE UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c0221

/dev/input/event3: EV_KEY KEY_SEARCH DOWN

/dev/input/event3: EV_SYN SYN_REPORT 00000000

/dev/input/event3: EV_MSC MSC_SCAN 000c0221

/dev/input/event3: EV_KEY KEY_SEARCH UP

/dev/input/event3: EV_SYN SYN_REPORT 00000000

I got the codes above by pressing, respectively:

1, INFO, VOICE ASSISTANT, NETFLIX, PRIMEVIDEO, MI (PatchWall), EXIT, MUTE, VOLUME UP, VOLUME DOWN, RED, GREEN, YELLOW and BLUE

------------------------------------------------ADB------------------------------------------------

C:\adb>adb shell

aquaman:/ $ getevent -pl

add device 1: /dev/input/event3

name: "Xiaomi RC"

events:

KEY (0001): KEY_ESC KEY_1 KEY_2 KEY_3

KEY_4 KEY_5 KEY_6 KEY_7

KEY_8 KEY_9 KEY_0 KEY_MINUS

KEY_EQUAL KEY_BACKSPACE KEY_TAB KEY_Q

KEY_W KEY_E KEY_R KEY_T

KEY_Y KEY_U KEY_I KEY_O

KEY_P KEY_LEFTBRACE KEY_RIGHTBRACE KEY_ENTER

KEY_LEFTCTRL KEY_A KEY_S KEY_D

KEY_F KEY_G KEY_H KEY_J

KEY_K KEY_L KEY_SEMICOLON KEY_APOSTROPHE

KEY_GRAVE KEY_LEFTSHIFT KEY_BACKSLASH KEY_Z

KEY_X KEY_C KEY_V KEY_B

KEY_N KEY_M KEY_COMMA KEY_DOT

KEY_SLASH KEY_RIGHTSHIFT KEY_KPASTERISK KEY_LEFTALT

KEY_SPACE KEY_CAPSLOCK KEY_F1 KEY_F2

KEY_F3 KEY_F4 KEY_F5 KEY_F6

KEY_F7 KEY_F8 KEY_F9 KEY_F10

KEY_NUMLOCK KEY_SCROLLLOCK KEY_KP7 KEY_KP8

KEY_KP9 KEY_KPMINUS KEY_KP4 KEY_KP5

KEY_KP6 KEY_KPPLUS KEY_KP1 KEY_KP2

KEY_KP3 KEY_KP0 KEY_KPDOT KEY_ZENKAKUHANKAKU

KEY_102ND KEY_F11 KEY_F12 KEY_RO

KEY_KATAKANA KEY_HIRAGANA KEY_HENKAN KEY_KATAKANAHIRAGANA

KEY_MUHENKAN KEY_KPJPCOMMA KEY_KPENTER KEY_RIGHTCTRL

KEY_KPSLASH KEY_SYSRQ KEY_RIGHTALT KEY_HOME

KEY_UP KEY_PAGEUP KEY_LEFT KEY_RIGHT

KEY_END KEY_DOWN KEY_PAGEDOWN KEY_INSERT

KEY_DELETE KEY_MUTE KEY_VOLUMEDOWN KEY_VOLUMEUP

KEY_POWER KEY_KPEQUAL KEY_PAUSE KEY_KPCOMMA

KEY_HANGEUL KEY_HANJA KEY_YEN KEY_LEFTMETA

KEY_RIGHTMETA KEY_COMPOSE KEY_STOP KEY_AGAIN

KEY_PROPS KEY_UNDO KEY_FRONT KEY_COPY

KEY_OPEN KEY_PASTE KEY_FIND KEY_CUT

KEY_HELP KEY_MENU KEY_CALC KEY_SLEEP

KEY_FILE KEY_WWW KEY_COFFEE KEY_MAIL

KEY_BOOKMARKS KEY_BACK KEY_FORWARD KEY_EJECTCD

KEY_NEXTSONG KEY_PLAYPAUSE KEY_PREVIOUSSONG KEY_STOPCD

KEY_RECORD KEY_REWIND KEY_PHONE KEY_CONFIG

KEY_HOMEPAGE KEY_REFRESH KEY_EXIT KEY_EDIT

KEY_SCROLLUP KEY_SCROLLDOWN KEY_KPLEFTPAREN KEY_KPRIGHTPAREN

KEY_NEW KEY_REDO KEY_F13 KEY_F14

KEY_F15 KEY_F16 KEY_F17 KEY_F18

KEY_F19 KEY_F20 KEY_F21 KEY_F22

KEY_F23 KEY_F24 KEY_CLOSE KEY_PLAY

KEY_FASTFORWARD KEY_BASSBOOST KEY_PRINT KEY_CAMERA

KEY_CHAT KEY_SEARCH KEY_FINANCE KEY_CANCEL

KEY_BRIGHTNESSDOWN KEY_BRIGHTNESSUP KEY_KBDILLUMTOGGLE KEY_SEND

KEY_REPLY KEY_FORWARDMAIL KEY_SAVE KEY_DOCUMENTS

KEY_UNKNOWN KEY_VIDEO_NEXT KEY_BRIGHTNESS_AUTO BTN_MISC

KEY_SELECT KEY_GOTO KEY_INFO KEY_PROGRAM

KEY_PVR KEY_SUBTITLE KEY_ZOOM KEY_KEYBOARD

KEY_PC KEY_TV KEY_TV2 KEY_VCR

KEY_VCR2 KEY_SAT KEY_CD KEY_TAPE

KEY_TUNER KEY_PLAYER KEY_DVD KEY_AUDIO

KEY_VIDEO KEY_MEMO KEY_CALENDAR KEY_RED

KEY_GREEN KEY_YELLOW KEY_BLUE KEY_CHANNELUP

KEY_CHANNELDOWN KEY_LAST KEY_NEXT KEY_RESTART

KEY_SLOW KEY_SHUFFLE KEY_PREVIOUS KEY_VIDEOPHONE

KEY_GAMES KEY_ZOOMIN KEY_ZOOMOUT KEY_ZOOMRESET

KEY_WORDPROCESSOR KEY_EDITOR KEY_SPREADSHEET KEY_GRAPHICSEDITOR

KEY_PRESENTATION KEY_DATABASE KEY_NEWS KEY_VOICEMAIL

KEY_ADDRESSBOOK KEY_MESSENGER KEY_DISPLAYTOGGLE KEY_SPELLCHECK

KEY_LOGOFF KEY_MEDIA_REPEAT KEY_IMAGES KEY_BUTTONCONFIG

KEY_TASKMANAGER KEY_JOURNAL KEY_CONTROLPANEL KEY_APPSELECT

KEY_SCREENSAVER KEY_VOICECOMMAND KEY_BRIGHTNESS_MIN KEY_BRIGHTNESS_MAX

REL (0002): REL_HWHEEL

ABS (0003): ABS_VOLUME : value 0, min 0, max 668, fuzz 0, flat 0, resolution 0

MSC (0004): MSC_SCAN

LED (0011): LED_NUML LED_CAPSL LED_SCROLLL LED_COMPOSE

LED_KANA

input props:

<none>

View attachment 6074521