Forrest logo
back to the xmodmap tool

xmodmap:tldr:ffbbc

xmodmap: Reassign a key on the keyboard to another key.
$ xmodmap -e 'keycode ${keycode} = ${keyname}'
try on your machine

The command "xmodmap -e 'keycode ${keycode} = ${keyname}'" is used to redefine the mapping of a specific keycode to a specific key name on the X Window System.

Here's how the command works:

  1. "xmodmap" is a command-line tool in Linux that allows you to modify the keymaps and pointer button mappings in X. It is used to set the keyboard layout and customize key bindings.

  2. The "-e" option specifies that the following argument is an expression to be evaluated by xmodmap.

  3. Inside the single quotes, there is an expression or command to redefine the mapping.

  4. "${keycode}" is a placeholder representing a numerical keycode value. Keycodes are unique identifiers assigned to each key on the keyboard.

  5. "${keyname}" is a placeholder representing the desired key name to which the keycode should be mapped.

By running this command and replacing the placeholders with actual values, you can change the mapping of a specific keycode to a different key name. This can be useful for remapping keys or creating custom keybindings according to your preference.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the xmodmap tool