Getting Windows Keys to do Something Useful

Here's one way of getting those stupid Windows keys to do something useful in X for a change, it worked for me (using Window Maker):

1) Start X, run the "xev" program in a term window and then push all the keys in question (e.g. all the ones with silly Windows icons and so on, you'll probably have three or thereabouts). Make a note of the keycodes returned when the keys are pushed.

2) Edit your ~/.Xmodmap file and add the following lines:

keycode 115 = WinKey1
keycode 116 = WinKey2
keycode 117 = WinKey3
where the numbers following "keycode" are the keycodes you noted previously. Just make up any old name for the keysyms after the equals sign (e.g. "WinKey1" etc.)

3) Edit your /usr/lib/X11/XKeySymDB file and add the following lines:

WinKey1: 1000F001
WinKey2: 1000F002
WinKey3: 1000F003
where "WinKey1" and so on are the keysyms you chose before. Make up the values after the colon, but search through the XKeySymDB file to make sure that they have not already been used.

4) Now run xmodmap on your ~/.Xmodmap file:

xmodmap ~/.Xmodmap

5) You should now be able to use the Window Maker configuration utility (or equivalent for whatever WM you use) to assign the keys to whichever functions you fancy.

Good Luck!