Ubuntu: Creating a custom keyboard layout isn't working



Question:

I want to replace my alt keys with my control keys and then place the alt keys on the two menus keys besides the control key. The problem is that the key right of my right alt is actually the print screen button (I have a lenovo thinkpad t430) so I need to adjust this from the config file

I edited the symbols/us file and added severel adjustments such as adding the following:

key <LALT> {[Control_L]};  

into the English (US) keyboard (which I am currently using).

The change does not occur on my laptop. What am I doing wrong?


Solution:1

Why not use Xmodmap for what you are doing? A .xmodmaprc to swap alt and control would look like this:

remove control = Control_L  remove control = Control_R  remove    mod1 = Alt_L  remove    mod1 = Alt_R    ! make alt keys to control  keycode     64 = Control_L  keycode    108 = Control_R    ! and control keys to alt  keycode     37 = Alt_L  keycode    105 = Alt_R      add    control = Control_L Control_R  add       mod1 = Alt_L Alt_R  

Where 64 is the keycode of AltL. Your keycodes may vary, you can find them out with xev Start it and press the AltL key to see the keycode

$ xev  ...  KeyPress event, serial 24, synthetic NO, window 0x2c00001,      root 0xb9, subw 0x0, time 599529285, (-70,692), root:(572,713),      state 0x10, keycode 64 (keysym 0xffe3, Alt_L), same_screen YES,      XLookupString gives 0 bytes:       XmbLookupString gives 0 bytes:       XFilterEvent returns: False  ...  

You apply it with

$ xmodmap ~/.xmodmaprc  

I remapped my alt and control keys as well. You can take a look at my xmodmap.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »