Author Topic: Keyboard Mappings  (Read 3589 times)

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Keyboard Mappings
« on: September 11, 2007, 01:57:36 pm »
Just checking if someone has done the following before I invest any more time in it....

I have purchased a cheap "Windows MCE Compatible" remote which comes with a USB receiver - thinking that this would just work using LIRC and the lirc_mceusb2 driver.
When I plugged it in straight away a few of the things worked and I can basically use it as a mouse but LIRC didn't want anything to do with it.

It turns out that it emulates a keyboard and that it loads a keyboard driver for it. I tried rebuilding the lirc_mceusb2 driver with support for the vendor/device id but it seems that it would prefer to allocate the keyboard driver as a preference.

A few of the keys map to standard keyboard keys like the numbers and the arrow keys, however there is a lot more keys including media control keys like play, pause etc and volume up/down, channel up/down.

So firstly does anyone know if orbiter has keyboard equivalents for media control and if so what are they all? I guess knowing this I can use Xmodmap to assign all the remote keys.

Alternatively, does anyone else have any other ideas before I start looking through code... Anyone looked at this part of the code??

I also have a wireless keyboard that has a bunch of media keys along the top. It would be good to get those working too.

Regards
Darren

rwilson131

  • Veteran
  • ***
  • Posts: 118
    • View Profile
Re: Keyboard Mappings
« Reply #1 on: September 11, 2007, 09:17:18 pm »
I have been having problems with the LIRC Modules.  From what I can tell so far,
1. Kubuntu installs the lircd.conf file in /etc/lirc/ not /etc and the software is looking to add configuration information to a file that does not exist.  I was able to over come this by ln -s /etc/lirc/lircd.conf /etc/lircd.conf.  The interesting thing that happened though was that after a router reload /etc/lircd.conf has been overwritten, but it is no longer a symlink.

2. I had to edit /etc/lirc/hardware.conf file to reflect the driver= default and the device /dev/lirc0 ( as the defaults are not correct ie /dev/lirc or /dev/lirc/0)

Only then did the lircd restart without errors.

I have also noticed that since this recent update, The function of the remote buttons is completely different, which is probably what you are describing as emulating Keypresses.
you can try the following to see if the LIRC_DCE plugin is working.
Code: [Select]
/usr/pluto/bin/LIRC_DCE -d <device #> -r localhost Before the update, Back button while in different plugins acted as escape button and not taking you back in the orbiter. For instance, Mythtv bring up OSD, prior hitting Back would exit the OSD, now it returns you to the orbitors main screen, as if you hit Home before.  Recorded TV used to bring up Recorded TV shows with in mythtv, but now it always brings up the Video Menu.

There is table in the pluto_main called Remote Mapping which allows for remapping the button in different screens.

THis may be a place to look, but as best as I can tell the LIRC_DCE plugin is not starting properly, but I have not been able to debug it. 

I hope this is helpful,

ROb

darrenmason

  • Addicted
  • *
  • Posts: 529
    • View Profile
Re: Keyboard Mappings
« Reply #2 on: September 12, 2007, 01:01:36 am »
Rob,

Thanks for the help - but basically my remote is not using LIRC at all, instead it sees the remote as a keyboard and uses the appropriate keyboard driver (usbhid from memory).

I can actually load the lirc_mceusb2 driver successfully but the kernel is not probing for this driver because as far as it is concerned there is no free interfaces for the device. This is because it has used the keyboard driver for the device.

I tried for a while to get it to use the lirc driver instead of the keyboard driver but without really hacking it would just not call the probe callback in the driver (the hack was to rmmod usbhid and explicitly modprobe a rebuilt version of lirc_mceusb2)

So I checked that all the keys worked as keyboard keys (just ran showkey and pressed them all) and the ones that currently work are the ones that are using the same key codes as a normal keyboard. So I can basically control linuxMCE to a limited extent. There are a few weird mappings (like mute seems to operate the same as F8) but there are also quite a few buttons that don't seem to work (mainly the media control buttons).

I know that I can change the X windows mappings for keys so if I know what keycode that linuxMCE expects for say PAUSE(assuming there is one of course) then I can map my pause button to that and hopefully that will give me a fully functional remote(keyboard?). A side effect would also be that if I find out all the expected mappings for the functions then it should be quite straightforward to also map normal keyboards that have media player type keys on them.

I am starting to think that it may be a code change to orbiter or another device that sort of does the same thing as the LIRC_DCE based devices, but hoping that someone knew more.

Hope that explains it a bit better.

Regards
Darren