Linux: Keyboard Software Guide

By Xah Lee. Date: . Last updated: .

This page is a overview of how to create keyboard shortcuts, how to remap/swap keys, how to change keyboard layout.

Get a Programable Keyboard

The best solution is to get a programable keyboard, especially on linux.

Overview of Linux Key Programing

In Linux, there are 2 steps to create keyboard shortcuts:

  1. Action: A shell command that does something, for example, switch/close window, simulate key press, mouse click, launch app, open file, empty trash.
  2. Bind Key: Make a key press run a shell command/script.

Use System Settings

The most easy way to add a new keyboard shortcut or keyboard layout, is the system control panel in a graphical user interface (available in any of the Gnome, KDE, Ubuntu, Xfce, LXDE). Under the system control panel (aka Setting Manager or System Preference), usually there are apps named Window Manager, or Keyboard, or Keyboard Layout.

xfce window manager keys setup  2013-06-07
xfce window manager keys setup

The window manager typically lets you set keys related to manipulating windows, such as {switch, close, max/min, move, show/hide/iconify}, or switch workspace (aka virtual screen), etc.

xfce keyboard setting panel 2013-06-01
xfce keyboard setting panel

The keyboard setting tool typically lets you set a key to launch app, or run a shell script. But it cannot swap keys nor set a key to send key combo such as Ctrl+s.

Swapping Keys, Remap Keys


xmodmap is a simple tool that lets you remap/swap keys for apps running under X11.

Scancode, Keycode, Keysym

How to set system keyboard layout?

Keybinding in linux can be divided into 2 layers

Many keybinding setup works in X11 only. For example, it won't work in Linux: Virtual Terminal, nor single-user mode console.

The letter layout, is usually in the system layer. (but it can also be X11 layer only too.)

Linux Keyboard Software


other linux keyboard articles (likely outdated)

2011-06-20 Here's more articles and tools from Dotan Cohen: