Microsoft Keyboard Remapping/Hack

If found this perfect comment on how to remap the keys on a Microsoft keyboard which was posted in a comment by Martin Hennings on this blog:

The comment is:

I’m using a natural ergonomic 4000 right now and loving it!

Now I got the taste of hacking, so I’d like to give away a few neat tricks.

The types in the commands.xml as in
have these meanings:

0 disabled
1 wParam follows
5 KeySeq follows
6 Activator follows
… what …
<C104 Type="2" lParam="0x05" />
<C401 Type="3" wParam="0x00002" />
<C104 Type="4" wParam="0x2" lParam="0x01711" />
<C1003 Type="7" Subtype="0" />
<C1003 Type="7" Subtype="3" wParam="0x01672" />
<C1003 Type="7" Subtype="4" wParam="0x2" lParam="0x01672" />
… ever … ;)
maybe I'll figure them out, too, some time…

As for the wParam, please note the command to registry hacks in the next post…

These are the keycodes I have figured out so far:
(german keyboard layout “qwertz”)

back C100
forward C101
zoom up C319
zoom down C320
function keys with F-Lock off: (with F-Lock on they serve as regular F-keys)
F1 C302
F2 C203
F3 C204
F4 C307
F5 C308
F6 C309
F7 C900
F8 C901
F9 C902
who knows F10? "spell check"?
F11 C311
F12 C310
not sure:
search C104 or C315
home C106
The ones I haven't figured out yet: (most of them are probably not even on the natural ergonomic 4000)
?? <C103 Type="5" KeySeq="escape" />
?? <C300 Type="5" KeySeq="enter" />
?? <C1101 Type="6" Activator="HorizontalScroll" />
?? <C1003 Type="7" Subtype="0" />
?? <C204 Type="5" KeySeq="ctrl y" />
?? <C105 Type="6" Activator="AOLBrowserFavorites" />
and some more…
These are really strange:
<Send1 Type="1" wParam="0x07E95" />
<Send2 Type="1" wParam="0x07E96" />
<ForwardMail1 Type="1" wParam="0x07E86" />
<ForwardMail2 Type="1" wParam="0x07E8D" />
<ForwardMail3 Type="1" wParam="0x07E8E" />
What are they for?

me using XP Pro I changed the commands.xml a bit, like for notepad:

<Application UniqueName="Notepad_WinXP" AppName="Notepad">
<C315 Type="1" wParam="0x10015" />
<C307 Type="1" wParam="0x10001" />
<C308 Type="1" wParam="0x10002" />
<C309 Type="5" KeySeq="alt F4" />
<C311 Type="1" wParam="0x10003" />
<C310 Type="1" wParam="0x10006" />
<C204 Type="5" KeySeq="ctrl z" />
<C401 Type="0" />
<C100 Type="5" KeySeq="pageup" />
<C101 Type="5" KeySeq="pagedown" />
<C319 Type="6" Activator="ScrollUp" />
<C320 Type="6" Activator="ScrollDown" />

This means back and forward keys toggle PageUp and PageDown, while the zoom button scrolls.

As for what the

<C307 Type="1" wParam="0x17c25" />

do, I’m still not sure. They toggle some internal commands within the programs, but until now I couldn’t change them so they’d so anything useful. Better stick to the keyboard shortcuts, I guess.

some important KeySeq-codes:

alt ctrl shift uparrow downarrow leftarrow rightarrow pageup pagedown backspace space add subtract + - escape break home end |

The pipe sign “|” lets you specify keystroke series like pressing “alt f” and then “s” for “file” – “save” by notating: “alt f | s”. To do a ‘copy all’ per “ctrl a” “ctrl c” you need to write “ctrl a | ctrl c”. Although it seems that itype.exe accepts a max. of three piped commands.
At least this didn’t work out in firefox: “ctrl l | ctrl c | ctrl t | ctrl v | enter” for ‘duplicate tab’. 😦
“alt home” works, at least.

So far for now, have fun hacking!

btw, please excuse my english, as I am from Germany…


5 comments so far

  1. Jørgen on

    This is good stuff! Exactly what I was looking for, well done.

  2. Joel "Jaykul" Bennett on

    I took it a little further, and managed to get an XSL sheet that remaps all the Function keys so they work like they should even when F-Lock is toggled.

  3. Doutilliple on

    arm constantly viagra every now fleetingly

  4. daffy on

    f10 is c401

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: