January 27, 2009

Reset your keyboard in X

I was using VMware and my keyboard went to Horkytown. My recipe for resetting the keyboard (at least on Fedora 10):

  1. egrep -i 'rules|layout|model' /var/log/Xorg.0.log to find out your rules, layout, and model for your keyboard.
  2. setxkbmap -rules xorg -layout us -model pc105 substituting the values from step 1 where appropriate.

If you have to SSH in and do this, like I did, prepend DISPLAY=:0 to setkbmap of course.