Remap Keyboard Keys on elementary OS for Productivity
Keyboard remapping can remove small sources of friction that become distracting during a long workday: an unreachable Escape key, a modifier in the wrong place, or a shortcut that opens the wrong application. The best way to remap your keyboard keys on elementary OS for productivity is not always the most technical one. A built-in shortcut may handle a command neatly, while a low-level mapping is useful when the physical key itself must behave differently.
It helps to separate three jobs. Changing a keyboard layout alters characters and modifiers according to a national or regional arrangement. Assigning a custom shortcut connects a key combination to a command. Remapping changes the identity of a key at the input layer, so Caps Lock can produce Escape or a second Control modifier regardless of the application. For community troubleshooting and release-specific advice, the elementary now forums and guides are useful references when the method available in your release differs.
Australian hardware makes this practical rather than theoretical. Full-size boards sold by JB Hi-Fi, Centre Com, and Umart commonly use a US-style 104-key layout, while imported Logitech, Keychron, or Ducky models may arrive with ISO Enter shapes or unfamiliar modifier positions. Compact 65 and 75 percent keyboards are also widely available here, but their layer keys may be less convenient for repeated commands. Check the physical board rather than assuming its key labels match an Australian desktop keyboard.
The software side is similarly mixed. Select Australian English in the layout controls when you want local spellchecking, but keep the familiar US arrangement if that is what your workflow expects. People working from shared offices in Sydney, Melbourne, or Brisbane often switch between a work laptop, a loaner machine, and a home keyboard, so portable settings and clearly recorded mappings matter. Start with one reversible change, verify it in several applications, and avoid taking over a critical login or password key on the first attempt.
Choose the Right Remapping Layer
Begin by deciding what the remap must do in every application. If you want Super+Alt+T to open a terminal, a custom shortcut is cleaner and easier to undo. If you want Caps Lock to act as Control, or an extra key to act as Compose, the mapping belongs below the shortcut layer. A layout change is appropriate only when you want the character and modifier positions of another keyboard standard.
For elementary OS, the Settings keyboard panel is the best first stop for shortcuts. The layout controls, labelled Layouts or Input Sources depending on the release, can switch among Australian English, US English, and other layouts, but they do not reliably turn one arbitrary physical key into another. Use a system-wide input remapper for raw-key changes. This keeps the result consistent in the browser, Terminal, text editor, and full-screen applications.
A keyboard’s own firmware is another option. QMK- or VIA-compatible boards can store a layout in hardware and apply it to elementary OS, Windows, and macOS without a background service. That portability is attractive for hybrid workers, but firmware procedures differ by model and a mistaken flash can leave a board unavailable. Test a hardware map with the board connected to another computer, then change only one mapping in the operating system.
Check Your Session, Layout, and Hardware
First identify whether the current graphical session uses X11 or Wayland. Run this command in Terminal:
echo $XDG_SESSION_TYPE
Keyd can remap input in both X11 and Wayland sessions, whereas tools such as xmodmap and xbindkeys are principally X11 utilities. If you plan to use either of those tools, log into an X11 session before testing them. Changing the desktop session can otherwise make a working mapping appear to have vanished.
Under X11, xev can reveal the keycode assigned to a physical key. Start it, press the key you want to inspect, and note the keycode value in the output. Keycodes are not universal, so copying a command from the internet without checking can remap the wrong button. A hardware-based map avoids this uncertainty because it follows the board’s firmware layout.
Before editing anything, note the current Caps Lock, Num Lock, Escape, and modifier behaviour. Australian-market boards can combine ANSI and ISO conventions, particularly when equipment is imported or borrowed from an office in Europe. Confirm that Australian English is the active software layout and that the physical modifier you intend to remap is in the expected position.
Build Persistent Remaps With Keyd
Keyd is a suitable system-wide remapper for elementary OS because it operates close to the input device and works independently of individual applications. Install it from the configured Ubuntu repositories used by elementary OS:
sudo apt update
sudo apt install keyd
Create or edit /etc/keyd/remap.conf. This example turns Caps Lock into an additional Control key:
[main]
capslock = ctrl
Use esc instead of ctrl if the goal is to turn Caps Lock into Escape, which can suit terminal-heavy or Vim workflows. The mapping affects the key globally rather than only within selected applications. Keep the first configuration small so that an unexpected result remains easy to diagnose.
After saving the file, restart the service:
sudo systemctl restart keyd
sudo systemctl status keyd
The status output should show the service as active. Test the changed key in a plain text editor before relying on it in a terminal or browser. If the service reports a parsing problem, examine its recent messages with journalctl -u keyd -n 50.
Keyd takes priority at the device level, so it can interfere with GNOME or elementary OS shortcuts that use the same physical key. Avoid mapping Control, Super, or another critical modifier until normal typing and application switching have been verified. A service restart is usually enough to apply later edits, and the package enables the service for future sessions.
Use Built-In Shortcuts for Command Bindings
Open Settings, choose Keyboard, and locate the Shortcuts section. Releases that expose custom shortcuts include a Custom Shortcuts area where you can add a name, command, and key combination. This is the simplest choice for launching Terminal, switching to an application, or running a small script.
For example, a custom shortcut could use Super+Alt+T to open a terminal. Use kgx --window with the elementary terminal, gnome-terminal -- with GNOME Terminal, or x-terminal-emulator when the Debian alternatives package provides it. The command must be executable from the desktop session; a command that works only after entering a terminal may fail because its environment differs from the one used by Settings.
Built-in shortcuts are easy to revise and clearly visible, but they reserve whole combinations rather than changing a key’s identity. A command shortcut cannot make Caps Lock behave as Control in every application. It is also less suitable for unusual keys that the desktop does not expose, such as a dedicated Compose or secondary Menu key.
Avoid assigning a combination already used for workspace switching, screen capture, or the application menu. If the desktop displays a “set shortcut” dialog that waits for a key press, press the complete combination rather than an individual modifier. The recorded shortcut should then be tested with the application closed as well as open.
Test X11 Fallbacks and Resolve Conflicts
Xmodmap provides a useful temporary test under X11. If xev identifies Caps Lock as keycode 66, this command temporarily turns it into Escape:
xmodmap -e 'keycode 66 = Escape'
The keycode is only an example. Restore the original key with the matching Caps Lock keysym when finished:
xmodmap -e 'keycode 66 = Caps_Lock'
For a persistent X11 mapping, put the desired assignment in ~/.Xmodmap:
keycode 66 = Escape
Apply it with xmodmap ~/.Xmodmap. To run it at graphical login, create ~/.config/autostart/xmodmap.desktop with these contents:
[Desktop Entry]
Type=Application
Name=Apply Xmodmap
Exec=/bin/sh -c "sleep 2; xmodmap $HOME/.Xmodmap"
NoDisplay=true
Use xbindkeys when you need a custom key combination that the Settings panel cannot assign. Its ~/.xbindkeysrc file lists a command followed by its combination, but it remains an X11-only option. Do not run Xmodmap, keyd, and xbindkeys against the same key without testing carefully; competing layers can produce confusing results.
If a browser shortcut behaves incorrectly and YouTube playback starts buffering at the same time, separate the input problem from the graphics problem. Key remapping changes key events, not video decoding, so the YouTube buffering guide provides a separate path for playback troubleshooting.
Document, Verify, and Keep a Recovery Path
Test every mapping in a text editor, Terminal, browser, and an application that uses full-screen mode. Include the login screen, lock screen, and any remote-desktop client in the check. A mapping that works while the desktop is unlocked but blocks a password prompt can create unnecessary recovery work. Verify the normal modifier combination too, since changing one key can alter shortcuts that combine it with others.
Record the keyboard model, active layout, session type, exact mapping, and the program responsible for it. Keep a note of the original state as well as the changed state. For keyd, save a copy of /etc/keyd/remap.conf; for Xmodmap, retain the working ~/.Xmodmap. Comments in the configuration file can explain why a key was changed, which helps when the same office laptop reaches another user.
Plan the rollback before making the change permanent. Restore the previous keyd assignment and restart the service, or delete the Xmodmap autostart entry and run xmodmap with the original mapping. If keyd prevents the desktop from loading normally, use a TTY or recovery session to disable it with sudo systemctl disable --now keyd. Keep the ability to reach that recovery route before altering startup input.
Make the concrete next action this: open /etc/keyd/remap.conf, save the single mapping you intend to keep, and run sudo systemctl restart keyd.