Questions tagged [xmodmap]

Xmodmap is a tool found in the xll-xserver-utils package and it enables keyboard maps and pointer button mappings to be configured according to the user's preference. It is often used to set up custom keys such as launcher or media buttons on a laptop.

249 questions
162
votes
14 answers

How can I change what keys on my keyboard do? (How can I create custom keyboard commands/shortcuts?)

I want to change the key bindings on some of the keys on my keyboard. I want some to run commands and others to activate different keys. What applications can I use to do this? Index: Xbindkeys Default keyboard and shortcut settings (from…
Seth
  • 59,332
124
votes
5 answers

How do I turn off Caps Lock (the lock, not the key) by command line?

For some reason my laptop is stuck in Caps Lock. I have the Caps Lock key mapped by xmodmap to hyper_l, so I don't have a caps_lock key to turn it off. Is there a way I can turn it off by command line? It would be nice if I could reset the lock…
Echogene
  • 2,345
95
votes
11 answers

Permanent xmodmap in Ubuntu 13.04

I cannot make xmodmap run on login in Ubuntu 13.04. I have searched around, including in askubuntu and all answers I found do not work. I have a file named .Xmodmap in my home folder which contains the desired mappings. If I run it manually it works…
81
votes
9 answers

How do I switch the Command key and Control key on a MacBook Pro?

I have scoured the web, and I can't seem to get Xmodmap / anything to work properly. I want to swap BOTH my Command keys with my Control key - in essence, inverting what they do currently. How would I do that? I tried xmodmap -e "keycode 133 =…
Kyle L
  • 2,177
60
votes
5 answers

How do I clear xmodmap settings?

Exactly what the title asks. How do I clear xmodmap settings? I have an IBM model M, and somehow xkeycaps got it into its head that my End key was not any key at all. xev reports keypresses when I use it, so I know the event is being generated by…
Wayne Werner
  • 6,872
59
votes
8 answers

How do I set Xmodmap on login?

As my keyboard layout doesn't suit me, I run xmodmap on login. The script is named .profile and it runs OK, but it breaks the Unity interface. I want to know where to put the xmodmap line so that it executes on my login and doesn't break anything.…
42
votes
9 answers

How can I persistently remap keys in Ubuntu 16.04?

This is working for the current session: costales@dev:~/Desktop$ xmodmap -e "keycode 166 = less" costales@dev:~/Desktop$ xmodmap -e "keycode 167 = greater" Then I created this config file: costales@dev:~/Desktop$ cat ~/.Xmodmap keycode 166 =…
Costales
  • 2,318
37
votes
7 answers

Remapping Caps Lock to Control and Escape (not the usual way)

I know how to use xmodmap to remap the Caps lock key so it acts as a Control key, or as an Escape key. I would like to combine both features as follows: When I push, then release, the Caps lock key, it sends Escape. When I hold down Caps lock and…
31
votes
2 answers

How to swap Ctrl and Fn on a Lenovo Thinkpad keyboard?

I tried to exchange my Fn key with left Control, which didn't work. I used the command xev to get the keycodes/keysym. Afterwards I used: xmodmap -e 'keycode 151=Control_L' xmodmap -e 'keycode 37=XF86WakeUp' But it didn't change anything. I also…
29
votes
2 answers

What does "Key to choose 5th level" in gnome-keyboard-properties do?

There is an option to specify a key to be used to access 5th level on the keyboard in gnome-keyboard-properties ("Keyboard" under Hardware in System settings): But if I set the 5th level to AltGr and the third level to Right Ctrl and if I set key…
sup
  • 4,964
20
votes
7 answers

Why won't my ~/.Xmodmap file load on login?

I created the following ~/.Xmodmap file as per this answer. keysym Delete = Menu keysym Menu = Delete clear Lock keycode 0x42 = Escape In other words, swap Delete and Menu, and make Caps Lock an additional Escape. The next time I logged in, Ubuntu…
Matthew
  • 3,094
20
votes
2 answers

Windows-like global shortcuts with the key in Xubuntu

I would to define Windows-like shortcuts using the Super ("Windows") key. I'm running Xubuntu 11.04 (Natty). Using Settings->Settings Manager->Windows Manager->Keyboard I assigned Super+D to "Show desktop". Then, using Settings->Settings…
Vitor Py
  • 363
19
votes
3 answers

Remap a key combination to another combination, e. g. Super+Ctrl+Shift+J -> Ctrl+Shift+Left

I want to implement an addition key layer, so that I can access non-alphanumeric keys without having to move my wrists. I've been using Autokey for this purpose, but the experience was unsatisfactory: it had occasional lags and let original…
19
votes
3 answers

How to bind Ctrl+arrows to Home and End keys? xmodmap does not work

On Windows, I used to bind Ctrl+Left to Home and Ctrl + Right to End via ahk. Now I'm struggling to achieve this behavior in Ubuntu. I've tried editing /etc/inputrc: "\e[1;5C": end-of-line "\e[1;5D": beginning-of-line It works but only in the…
acid009
  • 301
18
votes
4 answers

How do you enable tap-to-click via command line?

You can use this to reverse scroll direction (natural scroll): xmodmap -e "pointer = 1 2 3 5 4 7 6 8 9 10 11 12" You can also set it back again with xmodmap -e "pointer = 1 2 3 4 5 7 6 8 9 10 11 12" and this to switch the left and right…
Wilf
  • 30,732
1
2 3
16 17