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.

learn more… | top users | synonyms

25
votes
1answer
8k views

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 ...
15
votes
3answers
15k views

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 ...
15
votes
5answers
9k views

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 ...
15
votes
3answers
10k views

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 ...
14
votes
1answer
12k views

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 ...
10
votes
4answers
8k views

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 ...
10
votes
2answers
944 views

Remap Caps Lock key to 'Run Command' (Alt+F2)

I'm trying to get rid of the Caps Lockkey and give it a better use. Since I constantly use the run command Alt+F2, I'd like to make Caps Lock trigger that action. I've found a couple of questions ...
8
votes
2answers
1k views

Map caps-lock key to middle mouse click

Since I rarely use caps-lock, I'd like to map the key to a middle mouse click instead. I would also like to map Alt+Caps Lock to the original function of the caps lock key, should I ever need it. I ...
8
votes
1answer
6k views

Windows-like global shortcuts with the <Super> key in Xubuntu [closed]

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 ...
7
votes
3answers
3k views

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, ...
7
votes
2answers
2k views

Simplest way to swap esc key with ` key

What is the simplest way to swap the functionality of the Esc key and the ` key? System ➜ Preferences ➜Keyboard ➜ Layouts ➜ Options let me swap my Ctrl key and Capslock key, which was good, but it ...
7
votes
1answer
217 views

How can I remove a single temporary key mapping without resetting the entire keymap?

So I saw this question the other day. The user's K key was broken and they wanted to map it to Right-Shift. A good answer popped up and I thought I'd test it to see if it worked. I ran: xmodmap -e ...
7
votes
3answers
2k views

How can I swap CAPSLOCK for BACKSPACE?

I want to swap Capslock with Backspace and came only so far as to mix them both together. By that I mean: hitting Capslock does work like the Backspace key, but also activates Caps (including the ...
7
votes
1answer
3k views

remap right alt to behave as right ctrl

I'm trying to remap my right alt to behave like my right ctrl so I can use my right thumb to press the ctrl button. This is ubuntu 12.04. I've created the file .Xmodmap in my home folder with the ...
7
votes
1answer
2k views

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

There is an option to specify a key to be used to acces 5th level on the keyboard in gnome-keyboard-properties ("Keyboard" under Hardware in System settings): But if I set the 5th level to AltGr ...
7
votes
4answers
637 views

.xmodmap doesn't work for two layouts

before doing the upgrade to Ubuntu 13.10 I was using two layouts for the Keyboard - GR & DE. I was able to set both in one .xmodmap, means I was able to configure GR and DE. Now, when I create a ...
7
votes
1answer
1k views

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 ...
6
votes
2answers
2k views

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 ...
6
votes
1answer
945 views

making any key into a modifier key

When one presses and holds down certain keys like Control, Alt, Super, no release event is generated while with other keys multiple release & press events are generated simulating the key being ...
6
votes
1answer
245 views

Map function+backspace to delete

I'm used to Apple laptops, on which Function + Backspace is mapped to Delete. I'm also okay with Shift + Backspace. Is there a way to obtain this? Note, I'm using Xmonad and have some keyboard ...
5
votes
2answers
674 views

How do you enable tap-to-click via command line, with `xmodmap`?

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 ...
5
votes
3answers
17k views

How to run commands at login on ubuntu 12.04?

I have the file ~/.xmodmap where i swap a few keys on my keyboard. This file was loaded properly on my previous Ubuntu desktop but since the upgrade to 12.04 it's no longer loaded when I login to my ...
4
votes
2answers
4k views

How to change decimal comma to decimal period in numpad?

How to change the decimal comma ',' to decimal period '.' in the numeric pad of the keyboard? I have used xmodmap but every time that I change my keyboard layout the changes (by xmodmap) are being ...
4
votes
2answers
487 views

how to remap Ctrl to Escape if pressed and released on its own

I want to remap Control, so that: If it is pressed and released with no other key, it acts as Escape. If it is pressed & held together with another key, it acts as Control (no change in ...
4
votes
2answers
2k views

Remapping keyboard shortcuts (copy, paste etc) to Alt key instead of Ctrl

Interestingly, it turns out this is almost impossible to do. Remapping Alt key to behave as another Ctrl key is not a solution because you lose the Alt key functionalities (some of which are ...
4
votes
1answer
278 views

Using setxkbmap for a simple remap (similar to xmodmap)

I've faced some issues after remapping keyboard with xmodmap: settings get reset randomly after 2-20 minutes after applying. Googled it but no help: something resets them, but all mentions apply to ...
4
votes
1answer
794 views

How do I remap the IJKL keys to arrow keys when I hold Alt down?

I need to remap IJKL to the arrow keys while alt is down. Also, modifiers should still work ie: Shift+Ctrl+Alt+L should map to Shift+Ctrl+RightArrow I was able to get this working using xbindkeys + ...
4
votes
1answer
373 views

How can I remap Control+m to Enter?

I'd like to remap some key behaviors globally. For example: Control + m -> Enter Control + [ -> Esc Is there any tool equivalent to Keyremap4Macbook ? Or is it possible to remap by using Xmodmap? ...
4
votes
0answers
312 views

Hyper does the same as super by default [closed]

Under the keyboard → layouts → options, one has the ability to 'Make caps lock an additional hyper'. This is a good feature because I personally abhor caps lock and like additional shortcuts. ...
4
votes
1answer
103 views

How to remap pgup and pgdown to home and end Thinkpad X1 Carbon Ubuntu 13.10 Gnome-shell

I have used the xmodmap technique, I even made a file called .Xmodmap and put it in the start up commands in the gnome tweak tool, but there are still occasions where the buttons don't perform what I ...
4
votes
3answers
770 views

How do I bind 'Menu key' to right 'Win key'?

I have a keyboard with two "Win" keys but without "Menu" key. I'd like to bind my right Win as Menu. I tried do used xev in terminal and get keycode for .Xmodmap file but can't take code of right Win. ...
3
votes
3answers
961 views

Script at Startup

I'm using 10.10 and I need to run a script in order to get a windows-like international keyboard layout - basically, it changes how dead keys work. (Original script from this page ...
3
votes
2answers
95 views

Keyboard modifier to use <CAPS> with xmodmap

I've just installed a fresh Ubuntu. For the last 2 years I've used a system that allowed me to use my <CAPSLOCK> key as a keyboard modifier to get the character I want. For isntance, if I ...
3
votes
1answer
358 views

Ubuntu 12.10 xmodmap reset after usb plug/unplug

In Ubuntu 12.10 my .Xmodmap settings get lost (reset) after I plug/unplug my wireless keyboard/mouse combo. Do you know how to prevent or override this behavior?
3
votes
1answer
856 views

xmodmap periodic resets on Xubuntu

I'm running Xubuntu 11.04 and i'm using a KeyOvation mac compatible Gold Touch keyboard. Because the weird ordering of ctrl, option, and the apple key, I wanted to remap the keys to my liking using ...
3
votes
1answer
1k views

Terminal command to control the standard Music/Video Player(Play/Stop/Next..)

After googling for a while now im unable(-.-) to find a solution for this: I want to tell my standard(as noted in settings) music/video player to play/stop/next via terminal. But with a global ...
3
votes
1answer
490 views

xmodmap works for gnome session, but not for apps?

I'm running Ubuntu 11.10 using the gnome-fallback mode with compiz. My keyboard is the Apple metal add-on USB keyboard. My .Xmodmap file is set to swap the Alt and Command keys. I built the key map ...
3
votes
1answer
288 views

Unable to get xmodmap working after suspend

I am using Ubuntu 14.04. I have a custom Xmodmap keyboard layout. However, when I resume after suspend, the layout is gone. I have tried all things which were mentioned in the answers to this ...
3
votes
1answer
357 views

Assigning Print button to screenshot not working after upgrade from 13.10 to 14.04

When I pressed the Print button, nothing happened. Checked in System Settings, the button is assigned to screenshot. If I assign ANY other button except Print, it works normally. Is this a known ...
3
votes
1answer
366 views

Changing keybindings for Ubuntu using xmodmap fails

I've changed some of the keybindings for my keyboard using xmodmap, I've specifically changed my caps-lock key to point to CTRL_L and my CTRL_L key to point to Super_L. This registers in xev but my ...
3
votes
0answers
3k views

How to remap Fn key combinations (Lenovo G500)

I am running Kubuntu 13.10 on a Lenovo G500 laptop. My question is similar to this one: How can I remap my F keys on my HP laptop? That is to say, my F1-F12 keys are mapped to certain special ...
3
votes
1answer
311 views

Change aphostrohe with AltGr + P using xmodmap

I'm struggling with changing one keybind with xmodmap. AltGr + P outputs þ, but I would like to change it to output '. xmodmap -pm outputs: xmodmap: up to 4 keys per modifier, (keycodes in ...
3
votes
0answers
1k views

How to share two keyboard on the same laptop, french iso layout and usa ansi layout keyboard with usb?

I recently buy a "noppoo choc mini" with this specific ANSI US-INTERNATIONAL pc84 layout. This specific keyboard have only 84 key , a 60% (compact tenkeyless) reduced layout My problem is ...
3
votes
2answers
541 views

Using xmodmap automatically after login

Every time i reboot or start my computer, ubuntu 13.10 looses my xmodmap. I have to type: xmodmap .Xmodmap and the mapping works. How can I have this xmodmap automatically?
2
votes
2answers
1k views

Making a backtick produce just a backtick

My backtick key (`) produces nothing when first pressed - I have to press it twice to generate a `. If I forget, and type ` e, I get an accented e character. I am only able to fix this temporarily, ...
2
votes
1answer
995 views

User-level script run by lightdm

I'd like to do key remapping that effects only my user, but everywhere within my window manager, not just in a terminal. In lightdm, I select awesome as my window manager and log in. Are there any ...
2
votes
2answers
946 views

Set Context Menu key to function as Right Control

Dell notebooks in Brazil and possibly other countries no longer ship with a right control key. This is bad for ergonomics, so I would like to set the context menu key to function as right control. ...
2
votes
2answers
2k views

Ubuntu 12.04 forgetting XModmap settings often

I have the following contents in my ~/.Xmodmap file. It seems a couple times a day (without rebooting or logging out) I need to rerun the command "xmodmap ~/.Xmodmap" to reset my settings. The only ...
2
votes
1answer
382 views

Set xmodmap control modifier combination

What is the syntax for making ctrl+q emit KP_7? How to revert it back? I've read the man page but it does not provide example.
2
votes
1answer
486 views

Xmodmap remapping modifiers not working?

I am using a new keyboard, and trying to set it up to mimic the keyboard on my laptop. I'm using xmodmap on Ubuntu 14.04, and can't get it to work. I cleared the modifier keys like so : xmodmap -e ...