[mythtv-users] updating a keymap

Stephen Worthington stephen_agent at jsw.gen.nz
Tue Nov 15 00:36:42 UTC 2016


On Mon, 14 Nov 2016 12:49:43 -0500, you wrote:

>On 11/13/2016 07:26 AM, Vincent McIntyre wrote:
>
>
>> I need to remap a few keys to scancodes less than 255.
>> The wiki page above refers to /usr/src/<linux>/input.h
>> but I can't find any header files that have that kind
>> of data in it.
>
>On Fedora you would need to install 'kernel-devel' and 'kernel-headers'
>
>Fedora puts the file at:
>
>/usr/src/kernels/`uname -r`/include/uapi/linux/input-event-codes.h.
>
>I have no idea where Ubuntu would put them but you need to have the 
>appropriate kernel set installed
>
>> Can anyone suggest how to find appropriate keycode names?
>
>
>
>> The remote is a little unusual. I have a
>> 'DVICO FusionHDTV DVB-T Dual Digital 4'
>> tuner card and the (IR) remote came with that.
>> The sensor for the remote plugs into the card
>> with a 3.5mm jack and I run the cable to the
>> front of the computer to a spot where the remote
>> can talk to it. Worked fine with LIRC on 14.04.
>> Now I'm trying to leave LIRC behind.
>>
>> The good news is the remote mainly works.
>> evtest sees the device (event15 in the list below)
>> and ir-keytable will talk to it if I specify the device, ie
>>   ir-keytable -t -d /dev/input/event15
>> Both report the same keycodes when I press any key, including
>> the ones that don't work in mythtv.
>>
>> The keytable I get from ir-keytable -r exactly matches
>> the one in /lib/udev/rc_keymaps/dvico_mce.
>>
>> The odd thing is the device does not show up in /sys/class/rc/,
>> only event10 and event16 do. So ir-keytable does not show the
>> device by default. Can anyone explain why this occurs?
>
>Quite different here:
>
>ls -A /sys/class/rc/
>lrwxrwxrwx  1 root root 0 Nov  6 12:02 rc0 -> 
>../../devices/pci0000:00/0000:00:04.0/usb3/3-5/3-5:1.0/rc/rc0
>
>[root at myth rc]# lsusb
>Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
>Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
>Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
>Bus 003 Device 003: ID 15c2:ffdc SoundGraph Inc. iMON PAD Remote Controller
>
>So Fedora does not put to the /dev/event instance although that exists 
>in /dev
>ls -A /dev/input/by-id/
>lrwxrwxrwx 1 root root   9 Nov  6 09:32 usb-15c2_ffdc-event-if00 -> 
>../event5
>
>
>> # evtest
>> /dev/input/event4:	iMON Panel, Knob and Mouse(15c2:ffdc)
>> /dev/input/event10:	iMON Remote (15c2:ffdc)
>
>I think you are testing the wrong event: the iMon remote is event4 and 
>10 not 15
>
>My system is using what you have as event10. My event4 gives a smaller 
>key list than the one for what you have as event10, But the keys which 
>do not work as all listed as  >255 in both lists. evtest wants to use 
>event 4. Now I have to figure out how to change that mapping... from the 
>'Panel, Knob' to the 'Remote'.
>
>Not that it seems to matter:
>
>> # ir-keytable
>> Found /sys/class/rc/rc0/ (/dev/input/event10) with:
>> 	Driver imon, table rc-imon-mce
>> 	Supported protocols: rc-6
>> 	Enabled protocols: rc-6
>> 	Name: iMON Remote (15c2:ffdc)
>> 	bus: 3, vendor/product: 15c2:ffdc, version: 0x0000
>> 	Repeat delay = 500 ms, repeat period = 125 ms
>
>My system reports /dev/input/event10 with
>     Driver imon, table rc_imon-pad
>     Supported protocols other
>(Well actually in my case, it is event5, but it is the Remote)
>
>So are close. You just need to find the correct input-event-codes.h file.
>Note that I posted the top section of my /etc/rc_keymaps/imon_pad on 
>this list a couple of days ago.
>But yell if you need help.
>
>Geoff

In Ubuntu, the input-event-codes.h file can be found at:

  /usr/include/linux/input-event-codes.h

and also in the kernel headers at:


/usr/src/linux-headers-4.4.0-47/include/uapi/linux/input-event-codes.h

(replace the kernel version numbers with the right ones for your
current kernel).

Note that the two files are not quite identical:

root at mypvr:/mnt# diff /usr/include/linux/input-event-codes.h
/usr/src/linux-headers-4.4.0-47/include/uapi/linux/input-event-codes.h
15,16c15,16
< #ifndef _INPUT_EVENT_CODES_H
< #define _INPUT_EVENT_CODES_H
---
> #ifndef _UAPI_INPUT_EVENT_CODES_H
> #define _UAPI_INPUT_EVENT_CODES_H


In general, if you are hunting for a file on your system, you should
install the mlocate package (unless it already is - a lot of distos
install it by default).  Then you can use the locate command to find
files anywhere on your mounted filesystems.  There is a cron job that
updates the location database daily, but if you suspect the file is
new since then, you can run the updatedb command to manually update
the database.  You probably need to do that immediately after
installing the mlocate package.

root at mypvr:/mnt# locate input-event-codes.h
/mnt/ssd1/usr/include/linux/input-event-codes.h
/mnt/ssd1/usr/src/linux-headers-4.4.0-45/include/uapi/linux/input-event-codes.h
/mnt/ssd1/usr/src/linux-headers-4.4.0-47/include/uapi/linux/input-event-codes.h
/usr/include/linux/input-event-codes.h
/usr/src/linux-headers-4.4.0-45/include/uapi/linux/input-event-codes.h
/usr/src/linux-headers-4.4.0-47/include/uapi/linux/input-event-codes.h


More information about the mythtv-users mailing list