Short version of what I want to accomplish: I have a foot pedal (INFINITY-IN-USB-1, if that's of any interest) that is implemented as a generic HID device, and I would like it to be behave as control and alt keys on linux. I'm looking for something on the level on X, i.e. not just individual programs.
Longer version: I have this setup working in Windows XP by calling dll RegisterRawInputDevices and GetRawInputData and listening to the input in a hidden windows. All is accomplished with a fairly straightforward Autohotkey script (can post here if anyone is interested). The point is, there is no need for any extra driver, etc.; only the native Windows dll's are needed.
I want this setup to work on linux (more specifically Gnome under Ubuntu, but I do occasionally use other distro/window manager, so solution on the level of X is appreciated). This foot pedal does not register itself as keyboard or even joystick, but as a HID device with UsagePage 12, Usage 3. I notice that the latest Ubuntu can detect and use the favorite keys on the Microsoft Natural Keyboard, which also register as HID device*. I make use of those keys on Windows using the same method as I use the foot pedal (i.e. without the bundled software). So I assume that this pedal thing can work on linux as well, but the question is how?
[I'm new to the lower-level stuff on Linux, so please be generous with links to introduction or tutorial whenever applicable.]
* For those not in the know, the Microsoft Natural Keyboard registers as both a regular keyboard and a generic HID device. Without some application (such as the bundled application) knowing how to interpret the HID input, the regular keys will work but the favorite keys and the special function keys are useless.
To clarify, linux is NOT seeing the pedal presses as input. It does recognize the USB device, but xev gives no output for pedal presses. I have seen reports of people succesefully using the pedal under WINE for transcription software, but that must work in a Windows way and does not give what I want (which is making the pedal look like a keyboard to all native linux apps). I wonder whether some low level linux keyboard driver is needed?
Here's some more information: If I issue this in the terminal
cat /dev/usb/hiddev0
(dev/usb/hiddev0
is my pedal), I get raw codes corresponding to my pedal presses. That's a start. I know what those raw code means: in binary, 0001, 0010, 0100 corresponds to each pedal, respectively, and combination of pedal presses sends combination of those binary number, and releases of pedal trigger input of whatever pedal still being pressed (if all pedal is up, 0000 is sent).
How to I get X to listen to dev/usb/hiddev0
and translate the raw codes into maybe a special keycode so that I can map them with xmodmap or something?