Jump to content
Flirc Forums
TMWNN

Flirc HID codes and Android keycode counterparts

Recommended Posts

Flirc has a hidden method for sending HID Consumer (page 12) codes:

flirc_util record_api x 102 where x is in decimal

flirc_util record_api 2 x where x is in hexadecimal

The first method is only documented in @yawor's forum post; the second is not documented anywhere except sort of in one comment by @jseymour. I tried every value for x from 0 to 0x29c (668 decimal), the highest listed in the HID documentation, to to see which ones cause Nvidia Shield TV to do things. Each is listed with the Android KEYCODE the resulting Flirc binding produced in Button Mapper. (The Flirc codes do not match Android keycodes' numbers.)

Flirc code | Android keycode
-----------|----------------
        48 | POWER1
        50 | SLEEP1
        52 | SLEEP1
        54 | BUTTON_1
        64 | MENU
        65 | DPAD_CENTER
        66 | DPAD_UP
        67 | DPAD_DOWN
        68 | DPAD_LEFT
        69 | DPAD_RIGHT
        70 | ESCAPE
        71 | NUMPAD_ADD
        72 | NUMPAD_SUBTRACT
       101 | CAMERA
       111 | BRIGHTNESS_UP
       112 | BRIGHTNESS_DOWN
       132 | ENTER
       137 | TV
(Live Channels app)
       138 | EXPLORER
       140 | CALL
       154 | DVR
(DVR functionality in Live Channels app)
       156 | CHANNEL_UP
       157 | CHANNEL_DOWN
       176 | MEDIA_PLAY
       177 | BREAK
       178 | MEDIA_RECORD
       179 | MEDIA_FAST_FORWARD
       180 | MEDIA_REWIND
       181 | MEDIA_NEXT
       182 | MEDIA_PREVIOUS
       183 | MEDIA_STOP
       184 | MEDIA_EJECT
       205 | MEDIA_PLAY_PAUSE
       207 | VOICE_ASSIST1
(general Google Assistant voice search)
       226 | VOLUME_MUTE
       233 | VOLUME_UP
       234 | VOLUME_DOWN
       386 | BOOKMARK
       387 | MUSIC
       394 | ENVELOPE
       397 | CONTACTS
       398 | CALENDAR
       402 | CALCULATOR
       406 | EXPLORER
       414 | POWER1
       418 | APP_SWITCH1
(Recents in Button Mapper)
       539 | COPY
       540 | CUT
       541 | PASTE
       545 | VOICE_ASSIST1
       547 | HOME
       548 | BACK
       549 | FORWARD
       550 | MEDIA_STOP
       554 | BOOKMARK
       563 | PAGE_UP
       564 | PAGE_DOWN

1 Did not produce Android keycodes in Button Mapper. I identified the corresponding keycodes based on what they caused Shield to do. Other Flirc codes may not generate Android keycodes but still do things that I did not notice.

I hope @jason will implement the ability to use flirc_util record_api in long press and/or macro, and perhaps other HID tables and/or true Android keycodes. The latter would obviate the need for apps like Button Mapper to convert HID codes to Android counterparts.

Until then, what is this list useful for today? Many of the Flirc codes produce bindings already available for use via the GUI or command line utilities. My remote has separate Play and Pause buttons, and I do prefer to bind the former to MEDIA_PLAY (not in GUI or command line utilities) and the latter to MEDIA_PLAY_PAUSE (which is). Otherwise, unused keybindings can be used in Button Mapper, or Keyboard/Button Mapper, to open specified apps or other duties              .

Edited by TMWNN
Ping

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...