As per /usr/share/doc/keyboard-configuration/README.Debian
:
In Debian the default keyboard layout is shared between the console and X. It is specified in /etc/default/keyboard
.
The comments in /etc/default/keyboard
(where the keyboard layout for tty is configured) state:
If you don't want to use the XKB layout on the console, you can specify an alternative keymap. Make sure it will be accessible before /usr is mounted.
There are some layout-related files in /etc/console-setup/*.kmap.gz
. Their names start with cached
, and the timestamp indicates that they are likely auto-generated when setting the keyboard layout. So non-XKB layouts seem to have no practical relevance, at least on a system with a GUI (not 100% sure about console-only systems; feel free to add that information if you have it).
In short, the keyboard layout files for tty and GUI are the same.
The actual keyboard layouts and related files are stored in /usr/share/X11/xkb/
. The symbols
dir holds the key mappings (i.e. which physical key generates which character when pressed, alone or with modifiers), and rules/evedv.xml
appears to be the map of keyboard layouts.
The source code is at https://gitlab.freedesktop.org/xkeyboard-config/xkeyboard-config.