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.

Filter by
Sorted by
Tagged with
60 votes
5 answers
64k 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 ...
14 votes
3 answers
12k 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 LED)....
9 votes
2 answers
2k 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 ...
1 vote
0 answers
46 views

Trouble changing Control_R to Shift_L

I have trouble changing my right control to left shift. The solution I had working in 18.04 was xmodmad /home/kameranis/.Xmodmap with the following contents. keycode 105 = Shift_L After upgrading to ...
0 votes
0 answers
145 views

Remap keys with xmodmap

Ubuntu 22.04 running inside MS Hyper-V. I have used xmodmap to remap my left arrow key to right Control key. The Left key is broken. From xmodmap -pk , we can see 100 is Left key, and 109 is Control_R ...
9 votes
2 answers
12k views

How to apply Xmodmap permanently

I had to make some changes to the xmodmap in my home directory. When I execute xmodmap ./.Xmodmap everything works as expected. But I can't figure out how to apply this permanently. I tried to add it ...
41 votes
9 answers
42k views

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@...
0 votes
0 answers
94 views

How to use xmodmap to map Right-Alt to Super (Windows) key?

I'm stuck trying to map Right-Alt to the Super ("Windows") key; I'm on Kubuntu 22.04 LTS. The keyboard I'm trying to use is an IBM Space Saver Keyboard ("SSK", 84 key ANSI layout, ...
18 votes
3 answers
6k views

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

How to map caps lock to arrow keys?

I am trying to map Caps Lock to the Down arrow key and Caps Lock with a shift modifier to the up arrow key. I've tried using xmodmap with the following input file: remove Lock = Caps_Lock keycode 66 ...
0 votes
0 answers
60 views

How to remap 'Esc' with '~'

I have a laptop. The Esc key stopped working. I would like to swap it with ~ this key which is never used by me. I'm a complete beginner on linux. If anyone could help or point me in the direction of ...
0 votes
0 answers
81 views

ubuntu 23.04 overwrite my personal .Xmodmap settings

I have been using personal .Xmodmap keyboard settings since Ubuntu 12.04 to Ubuntu 20.04. But in Ubuntu 23.04 the OS constantly overwrites these settings by LOCALE ones and I need to restart them by &...
0 votes
0 answers
92 views

Remap several key: Alt_L key to have the same behavior as Alt_R (or Alt gr) + remap caps lock to escape

I want to change the behavior of the Alt_L key on my keyboard (keycode 64) so that it has the same behavior as the Alt_R (keycode 108 or Alt gr) on Ubuntu 22.04. the output of the following command ...
20 votes
7 answers
35k 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 ...
0 votes
0 answers
238 views

Remapping of key with xmodmap is detected by xev but not by other apps?

So as I bought a laptop with a foreign keyboard (qwerty but I type in azerty most of the time) I don't have any dedicated key for chevrons (<>). That's annoying, so I want to remap my right ...
1 vote
1 answer
102 views

Need help converting Xmodmap to XKB

I've been using this .Xmodmap for years but now I'm switching to Wayland and I need to replace it: !remove Lock = Caps_Lock keycode 66 = Mode_switch keycode 108 = Mode_switch keycode 26 = e E ...
0 votes
1 answer
143 views

Disable home key in keyboard

My home key keeps pressing every time I use my laptop's keyboard so I am using an external keyboard right now, disabling the entire laptop keyboard. But I want to use the laptop's keyboard as I feel ...
-2 votes
1 answer
75 views

How do I disable the page down (number 3) key?

My keyboard has gone mad and keeps pressing the page down/number 3 key, it happens quite frequently. I have an idea of how I can disable it but when I try to get it's keycode it doesn't give me any ...
30 votes
2 answers
29k 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 37=...
4 votes
2 answers
6k 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. ...
1 vote
1 answer
492 views

Xmodmap: How to get Xmodmap on autostart

I am using "Ubuntu Xorg" inside of Ubuntu 21.10, cause on normal Ubuntu it was not possible for me to set up xmodmap inside of gnome applications (e.g. Firefox, LibreOffice, Terminal). My ...
80 votes
9 answers
141k 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 I ...
0 votes
0 answers
278 views

How to keep keyboard mapping after reboot?

In order to remap my keyboard I use the following commands: $ setxkbmap -layout fr -variant latin9 -option '' $ setxkbmap -option ctrl:nocaps $ printf "keycode 127 = Caps_Lock NoSymbol Caps_Lock&...
0 votes
1 answer
33 views

Capturing whether keycode 66 is associated with Hyper_L in bash script

I want to check whether keycode 66 is associated with Hyper_L by calling xmodmap -pke | grep "Hyper" and storing in a variable in a bash script. What can I do?
6 votes
2 answers
5k views

How to map [Alt] + [hjkl] keys to arrow keys?

I know how to map [AltGr] + [h|j|k|l] keys to arrow keys, like: [AltGr]+[h] ... [Left] [AltGr]+[j] ... [Down] [AltGr]+[k] ... [Up] [AltGr]+[l] ... [Right] [AltGr]+[ö] ... [Home] [AltGr]+[...
11 votes
2 answers
12k views

Trying to map <Ctrl>+<hjkl> to <Left Down Up Right> globally (Vim-like arrow keys) with xmodmap

I am trying to map Ctrl+H,J,K,L to arrow keys Left,Down,Up,Right, respectively, on Ubuntu OS (globally, not inside Vim). I've attempted the solution posted here, but the modifier commands are not ...
3 votes
1 answer
1k views

Keyboard remap [Alt_L] + {ijkl} as arrow {Up, Left, Down, Right}

I want to use 'ijkl' together with alt to act like arrow keys. i.e. Alt+i = Up , Alt+K = Down etc. I have tried xmodmap following this answer. The answer says that Alt modified key is the third column ...
0 votes
0 answers
195 views

xmodmap remappings not working correctly in all applications

I remapped some of my keys using a Mode_switch with the following .Xmodmap ! remove Caps Lock clear lock clear mod1 remove Lock = Caps_Lock remove Shift = Caps_Lock keycode 66 = Alt_L Meta_L Escape ...
0 votes
0 answers
305 views

To disable rightclick on ubuntu desktop

I using Ubuntu 20.04 and GNOME desktop manager for end users to access the remote based application. Due to some reason, I need to restrict the Right-Click access on Ubuntu desktop. I used xmodmap to ...
58 votes
8 answers
57k 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 ...
4 votes
1 answer
3k views

Remap keys via xmodmap no longer works

I recently switched to Ubuntu 17.10 from Ubuntu 16.04. So far, I used xmodmap to remove Caps_Lock and replace it with the backslash-symbol. This doesn't seem to work under 17.10 (maybe because xmodmap ...
4 votes
2 answers
549 views

How to get a description of the meaning of the modifier keys (modN) of xmodmap?

I've read the documentation below on xmodmap (and man xmodmap): https://wiki.archlinux.org/index.php/xmodmap#Keymap_table The documentation decribes modifier keys, and how to display the modifier ...
1 vote
0 answers
109 views

How can I change my Right Ctrl Key to act as a backslash?

I wanted to be able to change my Right Control key to be backslash. I know that this is possible with xmodmap, however I couldn't make ubuntu run it on startup even if I put it in .xinitrc or .Xmodmap ...
18 votes
4 answers
36k views

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" ...
5 votes
2 answers
359 views

Hyper-key u --> Like Arrow-Up

I made CapsLock the Hyper-key via gnome-tweaks Sorry, I have only the german screenshot. "Feststelltaste" means "CapsLock" Now I would like to map Hyper-u to Arrow-Up Hyper-n to ...
6 votes
2 answers
412 views

xmodmap stopped working in the latest Google Chrome update

I remap Insert,Home,Page Up, Delete, End, and Page Down, and it have worked for many years, but with the latest Google Chrome update, it ignores the remapping, and preforms the action if it where were ...
1 vote
1 answer
1k views

Ubuntu 22.04 how making rAlt + [hjkl] arrows keys

I have done this before on kubuntu but when I try to do this with xmodmap on ubuntu 22.04, the binds don't work. This is what I was using: xmodmap -e "keycode 108 = Mode_switch" xmodmap -e &...
1 vote
3 answers
969 views

xmodmap reverting periodically

I'm using xmodmap to swap control and command keys on my Macbook pro. However, periodically the key revert back to their original state and this is becoming quite annoying. I'm on Ubuntu 13.10 and I ...
6 votes
4 answers
4k views

How do I remap the caps lock key to the backspace key?

I have grown very comfortable to my Colemak keyboard layout (my typing speed has doubled since I started using it). My only problem with it is that there is no caps lock key because under this layout ...
3 votes
1 answer
985 views

I want to use Xmodmap along with multiple layouts

I usually use 3 keyboard layouts: US, BG, DE. As I need the DE layout only for Umlaute, I found the solution with modifying the keys in ~/.Xmodmap. The command xmodmap ~/.Xmodmap changes my US layout ...
3 votes
1 answer
2k views

xmodmap doesn't work anymore after upgrading to 22.04

I upgraded to the latest 22.04 LTS version this morning and after that my xmodmap script doesn't work anymore, i'm curious if something has changed that is causing the script to not work anymore. I ...
6 votes
0 answers
2k views

Mapping Left `Ctrl` and `fn` keys in Ubuntu 20.04.4 LTS

So I've spent a solid couple of hours trying to figure out how to remap a couple of keys on a Lenovo ThinkPad T440p laptop. This article from 2020 got me pretty close. It uses the xmodmap command to ...
8 votes
5 answers
7k views

How to map <modifier> + hjkl to arrow key functionality?

I've been getting so used to vim's hjkl for moving around recently, and find myself wanting to use them right after alt tabbing out of vim. What would be the best way to map fn + h/j/k/l to left/down/...
0 votes
0 answers
149 views

Key chords via xmodmap in 20.04

On macos I use a fabulous tool, Karabiner Elements, to obtain the ability to use the return key as a control modifier key when typed with another key. Same for the caps lock key. Now that I am moving ...
2 votes
1 answer
154 views

Mapping `del` functionality onto another key doesn't preserve single-press repeat functionality

My del key is working just fine with single-press repeat actin (i.e. if I keep it pressed, it keeps deleting characters) but if I try to map it (or the DEL functionality` onto another key, this breaks....
0 votes
2 answers
170 views

Xmodmap: On Lenovo Thinkpad T420 not working?

I use a Lenovo ThinkPad T450 laptop (Linux 5.13.0-28-generic x86_64) with a german keyboard layout. Unfortunately the greater and lesser key is not available on this setup. I can not switch the keys ...
1 vote
1 answer
387 views

Remapping Caps-Lock to ESC doesn't deactivate the "capslocking"

I'm the happy owner of an Asus ZenBook Prime UX31A-R4005P running Kubuntu 13.04. I'm also a happy vim user; that means I'm lazy and don't like my hands to move more than they should. I did remap my ...
11 votes
1 answer
8k views

How to remap key with shift and alt modifier using xmodmap?

I want to put have the following behaviour for key with code 94: by default it is '<' with Shift it is '>' with Alt it is '|' I only managed to get the default and Shift behaviour by using ...
4 votes
2 answers
363 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 Caps Lock key as a keyboard modifier to get the character I want. For isntance, if I wanted the ...
2 votes
1 answer
370 views

Map CapsLock key to Return

I want to remap my CapsLock key to work as if it was a Return key. I've created a xmodmap file like this: remove Lock = Caps_Lock keycode 66 = Return If i run it from Terminal: xmodmap /home/me/mods/...

1
2 3 4 5