[mythtv-users] different key remappings for different keyboards? [kernel-level SOLUTION]

Michael T. Dean mtdean at thirdcontact.com
Tue Feb 9 19:32:33 UTC 2010


On 02/08/2010 07:07 PM, Alen Peacock wrote:
> On 02/08/2010 10:01:54 PM, Michael T. Dean wrote:
>
>> This is the entire reason LIRC was invented.
>>
> This remote appears as a normal keyboard,* not as an IR device...
> Maybe I don't understand LIRC -- does it control normal usb input
> devices (mouse and keyboard) as well as IR controllers?
>
> -j
>
> * actually, it appears as two devices, one is a keyboard, and the
> other is a mouse. It's quite the nice little jobber.
>

See, that's the thing...  Because the kernel developers are operating 
under some false impression that you can remap keyboard keys in such a 
ways as to make a) all applications and b) all users happy, they have 
included drivers in the kernel that allow basically every remote in 
existence to be used as a "normal keyboard, not as an IR device." 
Fortunately, those who are willing to do a little bit of extra 
configuration can cause that same remote to be used as a LIRC device 
(through a variety of mechanisms--blacklisting the kernel keyboard 
driver for the remote and instead installing a LIRC driver for the 
remote, using the LIRC /dev/input driver with the remote, ...).

The specific configuration required is left as an exercise to the reader 
(in other words, I have no clue how to make that specific remote work, 
but I'd guess the easiest approach would be using the /dev/input driver 
for LIRC).

With the kernel keyboard driver approach you're forced to change the 
keysyms (symbolic name of a key on a keyboard) associated with the 
keycodes (or scan codes--roughly corresponding to a physical key on the 
keyboard), as interpreted by the kernel.  With the LIRC approach, you 
can actually specify on a /per-application/ basis the exact 
string/message that's sent to the application (where Myth uses strings 
that correspond to keysyms) when LIRC receives the input event from a 
button press.  Therefore, you don't have to reconfigure every single 
application's key bindings such that they work the way you want them to 
work for your "keyboard" and you don't have to use every "keyboard" the 
same way (i.e. the physical position of the keys is irrelevant) and you 
don't have to modify the kernel keyboard driver to interpret scan codes 
as different key codes.

Basically, LIRC puts the configuration of keyboard/remote into a LIRC 
configuration rather than requiring you to configure every app to use a 
single, specific keyboard configuration. <my $0.02>Kernel keyboard 
drivers for remotes are for users who want Plug 'n' Play (and you get 
what you're given) configuration and would prefer to reconfigure 
themselves/their way of thinking rather than reconfigure their 
systems.</my $0.02>

Mike


More information about the mythtv-users mailing list