{{Article summary text|A general overview of modifying keymaps and pointer mappings with xmodmap.}}

{{Article summary text|A general overview of modifying keymaps and pointer mappings with xmodmap.}}

Line 19:

Line 19:

This process is complicated by [[Xorg]], which starts its own table of keycodes. Each keycode can belong to a {{ic|keysym}}. A keysym is like a function, started by typing a key. Xmodmap allows you to edit these keycode-keysym relations.

This process is complicated by [[Xorg]], which starts its own table of keycodes. Each keycode can belong to a {{ic|keysym}}. A keysym is like a function, started by typing a key. Xmodmap allows you to edit these keycode-keysym relations.

+

+

{{pkg|xkeycaps}} provides a graphical front-end to xmodmap, you can [[pacman|install]] it from the [[official repositories]].

== Keymap table ==

== Keymap table ==

Line 46:

Line 48:

Make the desired changes to {{ic|~/.Xmodmap}} and then test the new configuration with:

Make the desired changes to {{ic|~/.Xmodmap}} and then test the new configuration with:

xmodmap ~/.Xmodmap

xmodmap ~/.Xmodmap

+

+

{{Accuracy|Some desktop environments such as [[GNOME]] should automatically detect the file and ask you if you want to use it.}}

To activate your custom table when starting Xorg add the following:

To activate your custom table when starting Xorg add the following:

{{hc|~/.xinitrc|

{{hc|~/.xinitrc|

−

if [ -f $HOME/.Xmodmap ]; then

+

if [ -s ~/.Xmodmap ]; then

−

/usr/bin/xmodmap $HOME/.Xmodmap

+

xmodmap ~/.Xmodmap

fi}}

fi}}

Line 62:

Line 66:

== Special keys/signals ==

== Special keys/signals ==

−

You can also also edit the keys: {{Keypress|Shift}}, {{Keypress|Ctrl}}, {{Keypress|Alt}} and {{Keypress|Super}} (there always exists a left and a right one (Alt_R=AltGr))

+

You can also also edit the keys: {{Keypress|Shift}}, {{Keypress|Ctrl}}, {{Keypress|Alt}} and {{Keypress|Super}} (there always exists a left and a right one (Alt_R=AltGr)).

+

+

For example this can be useful if your right Control key is not working like your left one but you would like it to.

At first you have to delete/clear the signals that should be edited. In the beginning of your {{ic|~/.Xmodmap}}:

At first you have to delete/clear the signals that should be edited. In the beginning of your {{ic|~/.Xmodmap}}:

Line 88:

Line 94:

!add Mod5 =

!add Mod5 =

The {{Keypress|Super}} keys have now been exchanged with the {{Keypress|Ctrl}} keys.

The {{Keypress|Super}} keys have now been exchanged with the {{Keypress|Ctrl}} keys.

+

+

If you get the following error message {{ic|X Error of failed request: BadValue (integer parameter out of range for operation)}} it means the key you are trying to add is already in another modifier, so remove it using "remove MODIFIERNAME = KEYSYMNAME". Running {{ic|xmodmap}} gives you a list of modifiers and keys that are assigned to them.

== Reverse Scrolling ==

== Reverse Scrolling ==

−

The natural scrolling feature available in OS X Lion can be mimicked with xmodmap. Since the synaptics driver uses the buttons 4/5/6/7 for up/down/left/right scrolling, you simply need to swap the order of how the buttons are declared in {{ic|~/.Xmodmap}}.

+

The natural scrolling feature available in OS X Lion (mimicking smartphone or tablet scrolling) can be replicated with xmodmap. Since the synaptics driver uses the buttons 4/5/6/7 for up/down/left/right scrolling, you simply need to swap the order of how the buttons are declared in {{ic|~/.Xmodmap}}.

Open {{ic|~/.Xmodmap}} and append the following line to the file:

Open {{ic|~/.Xmodmap}} and append the following line to the file:

Line 97:

Line 105:

Then update xmodmap:

Then update xmodmap:

−

# xmodmap ~/.Xmodmap

+

xmodmap ~/.Xmodmap

To return to regular scrolling simply reverse the order of the 4 and 5 or delete the line altogether. For more information check Peter Hutterer's post, [http://who-t.blogspot.com/2011/09/natural-scrolling-in-synaptics-driver.html Natural scrolling in the synaptics driver], or the [https://bbs.archlinux.org/viewtopic.php?id=126258 Reverse scrolling direction ala Mac OS X Lion?] forum thread.

To return to regular scrolling simply reverse the order of the 4 and 5 or delete the line altogether. For more information check Peter Hutterer's post, [http://who-t.blogspot.com/2011/09/natural-scrolling-in-synaptics-driver.html Natural scrolling in the synaptics driver], or the [https://bbs.archlinux.org/viewtopic.php?id=126258 Reverse scrolling direction ala Mac OS X Lion?] forum thread.

Contents

Introduction

The Linux kernel generates a code each time a key is pressed on a keyboard. That code is compared to a table of keycodes defining a figure that is then displayed.

This process is complicated by Xorg, which starts its own table of keycodes. Each keycode can belong to a keysym. A keysym is like a function, started by typing a key. Xmodmap allows you to edit these keycode-keysym relations.

If you get the following error message X Error of failed request: BadValue (integer parameter out of range for operation) it means the key you are trying to add is already in another modifier, so remove it using "remove MODIFIERNAME = KEYSYMNAME". Running xmodmap gives you a list of modifiers and keys that are assigned to them.

Reverse Scrolling

The natural scrolling feature available in OS X Lion (mimicking smartphone or tablet scrolling) can be replicated with xmodmap. Since the synaptics driver uses the buttons 4/5/6/7 for up/down/left/right scrolling, you simply need to swap the order of how the buttons are declared in ~/.Xmodmap.