LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Resetting xmodmap from the commandline? (https://www.linuxquestions.org/questions/linux-desktop-74/resetting-xmodmap-from-the-commandline-859143/)

dewdrop_world 01-27-2011 09:46 PM

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.)

Thanks,
James

dewdrop_world 01-27-2011 11:53 PM

Never mind... I decided to do a little more Web searching and found that the limitation in virtualbox has been removed in the recently available vbox 4.0.

http://www.virtualbox.org/ticket/1891

So now, I can start the virtual machine without having to monkey around with the keyboard at all!

A real fix is always better than a workaround... props to the vbox team for addressing it properly.

James


All times are GMT -5. The time now is 05:52 AM.