Computer_Science
 Home | People | Curriculum | Projects | Resources | Media

Simplified keyboard remapping for X

I have written a small csh script to simplify keyboard remapping via xmodmap. I use this primarily for setting up Dvorak keyboard layouts on my Sun. My script reads one file describing the numeric keycodes generated by the keyboard, and another describing the desired mapping.

Both of the above files are laid out in a format that visually resembles the keys on the "central" part of the keyboard, as shown below.

In the keyboard file, the rows are pairs of characters, giving the unshifted and shifted meaning of the key.

For example, here is the keyboard file for QWERTY:

1!  2@  3#  4$  5%  6^  7&  8*  9(  0)  -_  =+
qQ wW eE rR tT yY uU iI oO pP [{ ]}
aA sS dD fF gG hH jJ kK lL ;: '"
zZ xX cC vV bB nN mM ,<> /?

In the keycode file, these rows are made up of numbers giving the keycodes needed by xmodmap. For example, on my SparcStation 5, I use

37  38  39  40  41  42  43  44  45  46  47  48
61 62 63 64 65 66 67 68 69 70 71 72
84 85 86 87 88 89 90 91 92 93 94
107 108 109 110 111 112 113 114 115 116

WARNING: Before you run this script the first time, I recomment putting an entry in your root menu of your window manager to reset to a keyboard you know.

On this web site, I have the following:

Haverford College Page maintained by John Dougherty, David Wonnacott, and Rachel Heaton.
Computer Science Department, Haverford College.