This looks *exactly* like what I was looking for. Thanks for the work and the explanation David -- I'll try it out tonight!<div><br></div><div>-j<br><br><div class="gmail_quote">On Mon, Feb 8, 2010 at 3:06 PM, David Kubicek <span dir="ltr"><<a href="mailto:foceni@gmail.com">foceni@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On 02/08/2010 07:50 PM, David Kubicek wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 02/08/2010 06:37 PM, j2u4 j2u4 wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My myth frontend has two keyboards -- the regular one, and a nice<br>
VRC-1100 remote control (all buttons register as keypresses).<br>
<br>
I would like the buttons that generate ESC and BACKSPACE remapped on the<br>
remote control, which I can do easily enough with xmodmap. But I'd also<br>
like the buttons on the regular keyboard to *not* be remapped. I don't<br>
think there is any way to do that with xmodmap, since the mappings are<br>
not device-specific. But maybe it can be done lower down, like with<br>
setkeycodes? Has anyone played with this?<br>
<br>
</blockquote></blockquote>
<br>
I checked keyfuzz out (I mentioned it earlier) and it works great, I just had to find a few things which changed in kernel since then make two changes in the source accordingly. Remember, you're changing the runtime translation tables in the very heart on the Linux INPUT system, so this mapping is completely transparent on all levels. No other configuration is necessary.<br>
<br>
You need to install these packages: xmltoman, gengetopt, gperf, joystick. Plus, of course, gcc, autoconf, automake and similar tools (some are in pkg "build-essential" in Debian/Ubuntu). Then get the source and apply my attached patch:<br>
<br>
# git clone git://<a href="http://git.0pointer.de/keyfuzz.git" target="_blank">git.0pointer.de/keyfuzz.git</a><br>
# cd keyfuzz<br>
# ./bootstrap.sh<br>
# ./configure<br>
# cd src<br>
# patch -p1 < keyfuzz.patch<br>
# make<br>
<br>
Done. Now find which /dev/input device corresponds to which keyboard (using "lsinput" from input-utils) or "lshal" can tell you directly if you don't mind searching for a while.<br>
<br>
Now to scancode/keycode mapping. The following will print out the complete mapping table. Save it. :)<br>
<br>
# src/keyfuzz -d /dev/input/event4 --get<br>
<br>
You need to find a line like this if you want to remap ESC:<br>
<br>
0x70029 KEY_ESC<br>
<br>
Think of another mapping you want that scan code (HW button) to map to and when ready (let's say ESC key should be TAB), run:<br>
<br>
# echo "0x70029 KEY_TAB" | src/keyfuzz -d /dev/input/event4 --set<br>
<br>
You can include several commands like this in your /etc/rc.local or similar location to make them permanent. Possibly copy the keyfuzz binary into /usr/local/bin/ (or run "make install" if you don't mind the unnecessary mess).<br>
<br>
The complete list of KEY_* values is in /usr/include/linux/input.h<br>
For testing your results, use "evtest" tool from the joystick package I listed.<br>
<br>
That's it, easy. Except this won't work for input devices requiring "uinput" module. It's a kernel INPUT driver for user-space daemons (like BlueZ) which allows them to plug into kernel INPUT. So most IR and BT keyboards cannot be remapped in this way. Uinput doesn't keep a keymap table, it's a responsibility of the user-space application. You'd have to hack on BlueZ or Lirc daemon sources to change the mapping.<br>
<br>
<br>
-- <br><font color="#888888">
David Kubicek<br>
</font></blockquote></div><br></div>