Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I would like to change my keyboard layout individually. For example switch the A key to B. Do I need a special software or is it possible directly in Ubuntu 12.04?

I found a ru file under /usr/share/X11/xkb/symbols which represents the keyboard layout. Unfortunately, I don't really understand the data structure.

If this is the only way to change the keyboard layout individually where can I find more information on the data structure and how to change it?

share|improve this question
add comment

marked as duplicate by Mitch, Eric Carvalho, green7, Mahesh, TheX Apr 24 '13 at 17:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 0 down vote accepted

You need to install these applications:

sudo apt-get install xbindkeys xautomation xev

Use "xev" to find the button number that you need. You will see a little white windows appear, put your mouse in it and press the button. You should get output like this for each button:

KeyRelease event, serial 41, synthetic NO, window 0x4e00001,
root 0xc6, subw 0x4e00002, time 430656, (39,24), root:(765,76),
state 0x10, keycode 38 (keysym 0x61, a), same_screen YES,
XLookupString gives 1 bytes: (61) "a"
XFilterEvent returns: False

KeyPress event, serial 41, synthetic NO, window 0x4e00001,
root 0xc6, subw 0x4e00002, time 432854, (39,24), root:(765,76),
state 0x10, keycode 56 (keysym 0x62, b), same_screen YES,
XLookupString gives 1 bytes: (62) "b"
XmbLookupString gives 1 bytes: (62) "b"
XFilterEvent returns: False

The important lines are the thirds.

Now create the xbindkeys config file using:

xbindkeys --defaults > $HOME/.xbindkeysrc  

Inside this file you can change behavior of all keys or combination of them.

gedit $HOME/.xbindkeysrc

Now you need to restart the pc.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.