This looks *exactly* like what I was looking for. Thanks for the work and the explanation David -- I&#39;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">&lt;<a href="mailto:foceni@gmail.com">foceni@gmail.com</a>&gt;</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&#39;d also<br>
like the buttons on the regular keyboard to *not* be remapped. I don&#39;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&#39;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 &quot;build-essential&quot; 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 &lt; keyfuzz.patch<br>
# make<br>
<br>
Done. Now find which /dev/input device corresponds to which keyboard (using &quot;lsinput&quot; from input-utils) or &quot;lshal&quot; can tell you directly if you don&#39;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&#39;s say ESC key should be TAB), run:<br>
<br>
# echo &quot;0x70029 KEY_TAB&quot; | 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 &quot;make install&quot; if you don&#39;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 &quot;evtest&quot; tool from the joystick package I listed.<br>
<br>
That&#39;s it, easy. Except this won&#39;t work for input devices requiring &quot;uinput&quot; module. It&#39;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&#39;t keep a keymap table, it&#39;s a responsibility of the user-space application. You&#39;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>