Re: [PATCH 3/3] keymaps: convert include files to use CSI keysyms

Alexey Gladkov <[email protected]> Mon, 22 Jun 2026 10:58:17 +0200
Newsgroups dev.linux.lists.kbd
Message-ID <[email protected]>
On Thu, Jun 11, 2026 at 09:48:57PM -0400, Nicolas Pitre wrote:
> Convert the shared keymap include files to use the new Csi_* keysyms
> for function keys (F1-F12) and navigation keys (Home, End, Insert,
> Delete, PageUp, PageDown). This fixes the long-standing discrepancy
> where F1-F5 used non-standard sequences (\e[[A through \e[[E) while
> F6 and above used standard CSI sequences.
> 
> The Csi_* keysyms automatically encode modifier state into the output
> sequence, so explicit shift/control bindings for F13-F36 are no longer
> needed and have been removed. The alt/control-alt bindings for console
> switching (Console_1 through Console_24) and other special actions
> (Scroll_Backward, Scroll_Forward, Boot) are preserved.
> 
> Updated files:
>   - linux-keys-bare.inc
>   - linux-keys-extd.inc
>   - linux-with-modeshift-altgr.inc
> 
> Legacy versions of these files are preserved as *-legacy.inc for
> keymaps that need the old F1-F246 keysym behavior.
> 
> Note: Standalone keymaps that don't use these include files (such as
> defkeymap.map and various language-specific keymaps) are not updated
> and will continue to use the legacy keysyms.
> 
> Note: The Csi_* keysyms require Linux kernel 7.1 or later. Keymaps
> built from these include files will leave the function and navigation
> keys inoperative on older kernels (and loadkeys additionally reports
> errors for them on non-Unicode consoles). Systems that must run
> pre-7.1 kernels should use the *-legacy.inc include files instead.

Existing keymaps continue to include files with their original names
such as linux-keys-bare.inc, etc. After an update, they automatically
become CSI variants. The presence of *-legacy.inc files alongside them
does not help keymaps that are already installed: none of them are
selected automatically.

This patch will break systems with pre-7.1 kernel.

I need to think about how to handle such migration.

> Signed-off-by: Nicolas Pitre <[email protected]>
> ---
>  .../i386/include/linux-keys-bare-legacy.inc   | 170 ++++++++++++++++++
>  data/keymaps/i386/include/linux-keys-bare.inc |  76 +++-----
>  .../i386/include/linux-keys-extd-legacy.inc   |  37 ++++
>  data/keymaps/i386/include/linux-keys-extd.inc |  23 +--
>  .../linux-with-modeshift-altgr-legacy.inc     | 101 +++++++++++
>  .../include/linux-with-modeshift-altgr.inc    |  52 ++----
>  6 files changed, 356 insertions(+), 103 deletions(-)
>  create mode 100644 data/keymaps/i386/include/linux-keys-bare-legacy.inc
>  create mode 100644 data/keymaps/i386/include/linux-keys-extd-legacy.inc
>  create mode 100644 data/keymaps/i386/include/linux-with-modeshift-altgr-legacy.inc
> 
> diff --git a/data/keymaps/i386/include/linux-with-modeshift-altgr-legacy.inc b/data/keymaps/i386/include/linux-with-modeshift-altgr-legacy.inc
> new file mode 100644
> index 0000000..29012ba
> --- /dev/null
> +++ b/data/keymaps/i386/include/linux-with-modeshift-altgr-legacy.inc
> @@ -0,0 +1,101 @@
> +# For keymaps in which AltGr_Lock is used to switch between two alphabets.
> +#
> +# A common construction is
> +#	alt keycode  42 = AltGr_Lock
> +#	altgr alt keycode  42 = AltGr_Lock
> +#
> +# All Linux keys have the same meaning with or without AltGr.
> +# No convention for Hex_* has been established.
> +
> +include "linux-keys-bare"

linux-with-modeshift-altgr-legacy.inc should include linux-keys-bare-legacy,
not the new linux-keys-bare.

-- 
Rgrds, legion