Tuesday, July 1, 2008

CyberLink Remote Control

The CyberLink IR receiver is recognized as two simple USB keyboard (I don't know why two) and one mouse.

Kernel Log:
kernel: input: TopSeed Tech Corp. USB IR Combo Device  as /class/input/input3
kernel: input,hidraw0: USB HID v1.00 Keyboard [TopSeed Tech Corp. USB IR Combo Device ] on usb-0000:00:02.1-3
kernel: input: TopSeed Tech Corp. USB IR Combo Device as /class/input/input4
kernel: input,hiddev96,hidraw1: USB HID v1.00 Mouse [TopSeed Tech Corp. USB IR Combo Device ] on usb-0000:00:02.1-3

With the default, not really useful (for me) keycodes are assigned.
For example the the red button has the keycode KEY_F15 (389), green KEY_F17 (391), yellow KEY_MEDIA (226), blue KEY_VIDEO (393). (The funny thing is: xev doesn't report these keys.)

Remapping with keycodes and scancodes doesn't work because USB keyboards have no scancodes. A good explanation you can find on http://lkml.org/lkml/2006/6/9/307.

I was looking for a simple way to remap the keys to other keys. I looked quick over http://lineak.sourceforge.net/ and maybe that will do it also. But i wrote my own program to change the keys.

With this program you set your own keycodes. The default mapping is for MythTv. The change the mapping, just edit keys.h and recompile the package.

The source code of the program is available under
http://twe.awardspace.com/cyberlink/

1 comment:

Unknown said...

I got the same remote recently and had a go at supporting it as well. It looks like some keys are on a USB HID page 0xffbc for some reason. I put together a fix for this and it should be in the main kernel tree as of 2.6.29-rc1. With this kernel all keys should generate codes, but you would still need to map the keycodes above 255 using lirc or something similar (until X learns to support them).