[Gllug] Logical place to map a key press

John Winters john at sinodun.org.uk
Sat Jan 28 12:45:15 UTC 2006


I'm setting up an infra-red remote control to use with MythTV.  It's
connected to a Nebula DVB-T card which uses the bttv module to drive it.
The basic functionality is working fine.  The bttv-input.c module maps
the keys on the remote to values defined in /usr/include/linux/input.h
and then they appear to applications as if they had been pressed on an
extra keyboard.  If I press the "1" key on the remote it is mapped by
bttv-input.c (by way of ir-keymaps.c) to KEY_1 and the application sees
it as if a 1 had been pressed on the normal keyboard.

My query comes with keys like "Menu".  This is mapped to KEY_MENU (as
defined in /usr/include/linux/input.h) but I'm not sure how to get that
into something useful for the application.  Obviously a normal keyboard
doesn't have a "Menu" key and normal apps don't expect to see anything
like that from the keyboard.  I could just edit ir-keymaps.c and map the
key instead to KEY_M which is what MythTV would like to see, but it
doesn't seem likely that this is the correct approach.  Modifying a
kernel module and then re-booting the system just to change a key map
doesn't sound to me like the Linux way of doing things.

Anyone know what the correct way of doing this would be?

TIA,
John

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list