Resetting xmodmap from the commandline?
I'm looking for a way to remove all xmodmap tweaks temporarily, preferably from the commandline. I have a couple of non-commandline workarounds:
- Log out, log back in.
- Unplug the USB keyboard and plug it back in.
- Go to keyboard preferences > layouts > options, change one of the options and close, then change the option back to what it was and close again. (I hoped that cnee would be able to reproduce the sequence of actions, but no dice -- apparently when the keyboard gets reset, cnee gets confused and stops playing. Or maybe it stopped recording, not sure.)
Reason (important, since this might rule out some solutions):
I'm using xmodmap to move the control keys next to the space bar. I have a RSI and it's painful to stretch all the way to the edge of the keyboard frequently.
I also use virtualbox to run NaturallySpeaking (tried wine, not stable enough). Virtualbox does not get along with xmodmap. Apparently xmodmap causes the OS to report a different keyboard identifier. Virtualbox doesn't recognize that ID and as a result, key codes sent into the guest are all wrong. (But, if I run xmodmap after the virtual machine is up, no problem.)
So what I need to do, probably 3-5 times a day, is to reset the keyboard just so I can start the virtual machine, then rerun my xmodmap script.
I'm not sure if it will help to run a different xmodmap script that returns the modifiers to their original position. That might not reset the ID that virtualbox reads from the OS.
Any ideas? (This forum seems like my last, best hope. I've asked a few times about xmodmap over at Ubuntuforums -- nobody has a clue about it over there.)