Friday, November 2, 2007

Worked around a keyboard problem in our lab

Today, I had to work with a broken keyboard where all the Shift+(non-keypad number) keys were broken. So, I could not get !@#$%^&*() characters. To work around this problem, I created a ~/.Xmodmap file containing the following.

-----------------------------------------------------------------------------------
# This maps the keypad number keys so that they generate
# the exclam, at, etc. characters when pressed aong with
# the Shift key. This rectifies a keyboard problem where
# all the Shift+(non-keypad number) keys were dead!

keysym KP_1 = KP_1 exclam
keysym KP_2 = KP_2 at
keysym KP_3 = KP_3 numbersign
keysym KP_4 = KP_4 dollar
keysym KP_5 = KP_5 percent
keysym KP_6 = KP_6 asciicircum
keysym KP_7 = KP_7 ampersand
keysym KP_8 = KP_8 asterisk
keysym KP_9 = KP_9 parenleft
keysym KP_0 = KP_0 parenright
--------------------------------------------------------------------------------

Now, instead of pressing Shift+2 for the @ character, I have to press Shift+KP_2 produce the @ character.

No comments: