SOLVED | How to swap Left Ctrl with Left Alt on a Ubuntu System

in #apple5 years ago


ubuntu

To swap left Ctrl with left Alt on a Ubuntu system manually you want to create a file called .Xmodmap in your home directory. You could do this using a command from the terminal.

~$ gedit ~/.Xmodmap
That will create the file and open it in gedit. Add the following lines to the file:
clear control
clear mod1
keycode 37 = Alt_L Meta_L
keycode 64 = Control_L
add control = Control_L Control_R
add mod1 = Alt_L Meta_L
Save the file and quit gedit. Next time you login the new keymappings will be active. To have the settings take immediate effect run the following command:
~$ xmodmap ~/.Xmodmap
There's a chance that the keycodes above are different on your computer. If the above doesn't work, try running the xev program from the command line. Xev will generate a new small window in the corner of your screen. If you start pressing keys on your keyboard you’ll get all the key mapping information for that key press.
~$ xev
For example if I press “q” when xev is running I get the following output:
KeyRelease event, serial 33, synthetic NO, window 0x4c00001,
root 0xb6, subw 0x0, time 9127480, (21,-17), root:(22,36),
state 0x0, keycode 24 (keysym 0x71, q), same_screen YES,
XLookupString gives 1 bytes: (71) "q"
XFilterEvent returns: False
keycode 24 is the information that we're after. Press your left Ctrl and left Alt buttons while running xev to get your own respective keycodes to confirm that they are the same as the ones used above.

Hope the article was helpful. Please share and do follow us. <br /><center><hr/><em>Posted from my blog with <a href='https://wordpress.org/plugins/steempress/'>SteemPress</a> : http://techvhow.com/solved-how-to-swap-left-ctrl-with-left-alt-on-a-ubuntu-system_390/ </em><hr/></center>

Sort:  

Congratulations @techvhow! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You got a First Vote

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

SteemFest3 and SteemitBoard - Meet the Steemians Contest

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @techvhow! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made your First Vote

Click here to view your Board of Honor
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:

SteemFest3 and SteemitBoard - Meet the Steemians Contest

Support SteemitBoard's project! Vote for its witness and get one more award!

Coin Marketplace

STEEM 0.25
TRX 0.11
JST 0.032
BTC 61830.08
ETH 2986.99
USDT 1.00
SBD 3.73