[mythtv-users] Using IR Remotes without LIRC

Tyler T tylernt at gmail.com
Fri Sep 26 00:55:04 UTC 2014


I just set up my FE with a USB MCE RC6 remote. I had a hard time
figuring out how to get LIRC to work, as there are 1,001 Myth/LIRC
tutorials out there on the 'net, most of which are out of date and the
rest which disagree with each other. So after struggling for a while,
I decided to just give up and use the kernel's built-in IR remote
support, which works great. This website has pretty good
documentation: http://atterer.org/mythtv-xmbc-remote-control-without-lirc

However, I have one important observation. That is that after running
ir-keytable -w, you MUST restart X for any newly added keys to be
recognized by X! (Modified keys will be recognized as their new
assignments without a restart.) This cost me a long evening of
frustration until I figured it out.

I used this as a reference to map MCE remote codes to valid keyboard
codes the kernel/X/Myth would recognize:
http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/input.h?v=2.6.11.8.
Remember that if you want to use remote buttons with default codes
>255 (>0xFF hex), remap them to something <255 from input.h. And
restart X!

I have reproduced my keymap here in case it helps other MCE RC6 remote
users. Most keys are the default Myth keybindings, there are only a
handful of custom keys I needed to add into Myth's keybindings in the
FE setup (I bound Prev/Next as TimestretchDEC/INC and the Asterisk as
ToggleAspect after removing it from ArbSeek). The original default
assignments are listed in comments.

scancode 0x800f0400 = KEY_0 (0x200) # NUMERIC_0
scancode 0x800f0401 = KEY_1 (0x201) # (etc...)
scancode 0x800f0402 = KEY_2 (0x202)
scancode 0x800f0403 = KEY_3 (0x203)
scancode 0x800f0404 = KEY_4 (0x204)
scancode 0x800f0405 = KEY_5 (0x205)
scancode 0x800f0406 = KEY_6 (0x206)
scancode 0x800f0407 = KEY_7 (0x207)
scancode 0x800f0408 = KEY_8 (0x208)
scancode 0x800f0409 = KEY_9 (0x209)
scancode 0x800f040a = KEY_DELETE (0x6f)
scancode 0x800f040b = KEY_RESERVED (0x1c) # ENTER
scancode 0x800f040c = KEY_SLEEP (0x8e)
scancode 0x800f040d = KEY_M (0xe2) # MEDIA
scancode 0x800f040e = KEY_MUTE (0x71)
scancode 0x800f040f = KEY_I (0x166) # INFO
scancode 0x800f0410 = KEY_VOLUMEUP (0x73)
scancode 0x800f0411 = KEY_VOLUMEDOWN (0x72)
scancode 0x800f0412 = KEY_PAGEUP (0x192) # CHANNELUP
scancode 0x800f0413 = KEY_PAGEDOWN (0x193) # CHANNELDOWN
scancode 0x800f0414 = KEY_DOT (0xd0) # FASTFORWARD
scancode 0x800f0415 = KEY_COMMA (0xa8) # REWIND
scancode 0x800f0416 = KEY_P (0xcf) # PLAY
scancode 0x800f0417 = KEY_RECORD (0xa7)
scancode 0x800f0418 = KEY_P (0x77) # PAUSE
scancode 0x800f0419 = KEY_STOP (0x80)
scancode 0x800f041a = KEY_F13 (0x197) # NEXT
scancode 0x800f041b = KEY_F14 (0x19c) # PREVIOUS
scancode 0x800f041c = KEY_W (0x20b) # NUMERIC_POUND
scancode 0x800f041d = KEY_KPASTERISK (0x20a) # NUMERIC_STAR
scancode 0x800f041e = KEY_UP (0x67)
scancode 0x800f041f = KEY_DOWN (0x6c)
scancode 0x800f0420 = KEY_LEFT (0x69)
scancode 0x800f0421 = KEY_RIGHT (0x6a)
scancode 0x800f0422 = KEY_ENTER (0x160) # OK
scancode 0x800f0423 = KEY_ESC (0xae) # EXIT
scancode 0x800f0424 = KEY_DVD (0x185)
scancode 0x800f0425 = KEY_TUNER (0x182)
scancode 0x800f0426 = KEY_EPG (0x16d)
scancode 0x800f0427 = KEY_ZOOM (0x174)
scancode 0x800f0432 = KEY_MODE (0x175)
scancode 0x800f0433 = KEY_PRESENTATION (0x1a9)
scancode 0x800f0434 = KEY_EJECTCD (0xa1)
scancode 0x800f043a = KEY_BRIGHTNESSUP (0xe1)
scancode 0x800f0446 = KEY_TV (0x179)
scancode 0x800f0447 = KEY_AUDIO (0x188)
scancode 0x800f0448 = KEY_PVR (0x16e)
scancode 0x800f0449 = KEY_CAMERA (0xd4)
scancode 0x800f044a = KEY_VIDEO (0x189)
scancode 0x800f044c = KEY_LANGUAGE (0x170)
scancode 0x800f044d = KEY_TITLE (0x171)
scancode 0x800f044e = KEY_PRINT (0xd2)
scancode 0x800f0450 = KEY_RADIO (0x181)
scancode 0x800f045a = KEY_SUBTITLE (0x172)
scancode 0x800f045b = KEY_RED (0x18e)
scancode 0x800f045c = KEY_GREEN (0x18f)
scancode 0x800f045d = KEY_YELLOW (0x190)
scancode 0x800f045e = KEY_BLUE (0x191)
scancode 0x800f0465 = KEY_POWER2 (0x164)
scancode 0x800f046e = KEY_PLAYPAUSE (0xa4)
scancode 0x800f046f = KEY_PLAYER (0x183)
scancode 0x800f0480 = KEY_BRIGHTNESSDOWN (0xe0)
scancode 0x800f0481 = KEY_PLAYPAUSE (0xa4)


More information about the mythtv-users mailing list