Configuring a key to work as replacement for another key on keyboard

0

Few days back one of my keyboard key('O') came out, and I can't it intact again. Is there any way to configure another key, or a combination of key to work as a replacement of the lost key?

I'm using Ubuntu 12.04 OS.

Rohit Jain

Posted 2013-06-29T07:55:20.073

Reputation: 101

Basically, you can. Just look up questions relating to [tag:autohotkey], as long as you're using Windows. But why don't you just buy a new keyboard? – user 99572 is fine – 2013-06-29T08:05:42.217

@user99572isfine. I'm using Ubuntu. And sure I can buy a new keyboard. That's certainly an option. But just wanted to know is there a way. – Rohit Jain – 2013-06-29T08:06:50.700

There is a answer on the askbuntu site about this same thing, may have wanted to check there first, which is usually best for ubuntu/linux questions in general. http://askubuntu.com/questions/24916/how-do-i-remap-certain-keys

– user88311 – 2013-06-29T12:42:47.783

Answers

2

For example, if you want the menu key to function like 'o', you can first create an xmodmap file:

$ xmodmap -pke > ~/.Xmodmap

Open the file and look for the line which contains the mapping for the menu key, something like:

keycode 135 = Menu Insert Menu

You can also start xev, type the menu key and look for the keycode in xev's output. Then, replace everything after the equals sign with the desired mapping, i.e., if you want it to behave like 'o', use something like:

keycode 135 = o O o O

To use the new xmodmap file, type

$ xmodmap ~/.Xmodmap

The settings are usually lost after shutdown, however, I'm not sure if Ubuntu somehow loads the .Xmodmap automatically.

helios35

Posted 2013-06-29T07:55:20.073

Reputation: 166