[mythtv-users] Remote control setup

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Apr 16 08:10:04 UTC 2021


On Thu, 15 Apr 2021 18:14:14 -0400, you wrote:

>Hello,
>I'm trying to tweak the rc6_mce keymap for my system to include the
>underscore key, "_" as the subchannel separator for tuning. I added this
>line, but it doesn't seem to have any effect.
>
>scancode 0x800f041d = KEY__ (0X14)
>>
>
>I also tried "KEY_UNDERSCORE" also with no results. The remote key in
>question is the * asterisk.  Also wondering if anyone has mapped PgUp/PgDn
>for quickly scrolling through the guide.
>
>Any thoughts?

Are you sure your changes are actually being applied?  How are you
changing the keymap file?  What disto are you using?

In Ubuntu, the keymap files changed name between 18.04 and 20.04 and
are now .toml files with a slightly different format.  The originals
are found in /lib/udev/rc_keymaps.  But you can not edit them in place
there as those files will get overwritten if the package gets updated.
So you want to copy the rc6_mce.toml file to /etc/rc_keymaps and edit
there.  Change /etc/rc_maps.cfg to point to your new rc6_mce.toml file
(use a full path: /etc/rc_keymaps/rc6_mce.toml).  Then run:

ir-keytable -a

to load your new configuration.  Add an "-s rcX" option if you have
multiple IR receivers and need to specify the one to use.  Then test
to see if your new key mapping is working using "ir-keytable -t".

If that works, then reboot and see if the new keytable is loaded
automatically.  It is possible that it will be now, but if not, then
you will need to add your "ir-keytable -a" command to /etc/rc.local
(with an & on the end of the line so it does not stop the rest of
rc.local from working).  Or you could write a systemd unit to run it
at startup.

The correct KEY_ names for all the keys are now found in:

/usr/src/linux-headers-$(uname
-r)/include/uapi/linux/input-event-codes.h

But here you run up against a fundamental problem - the underscore
character on a keyboard is not a single keystroke.  It is effectively
an upper case character, requiring the use of the shift key with the
minus key, or shift lock.  So it is not present as a KEY_ value in
input-event-codes.h.  As far as I know, it is impossible to get an IR
remote to create any upper case character - they can only create KEY_
codes found in input-event-codes.h.  A quick web search could not find
anything that says otherwise.  So as far as I can tell, there are only
two ways you can get an underscore character from an IR remote. Either
add KEY_UNDERSCORE to input-event-codes.h and recompile the kernel and
also any downstream software that is affected.  And keep adding this
patch every time the kernel is updated.  Or use LIRC, where it would
be easy to map KEY_KPASTERSISK (for example) to an underscore
character.


More information about the mythtv-users mailing list