[BRLTTY] Key combinations not (yet?) handled by the Linux virtual console
Aura Kelloniemi
kaura.dev at sange.fi
Mon Nov 24 17:22:01 UTC 2025
Hi,
On 2025-11-24 at 12:48 +0100, Sébastien Hinderer <Sebastien.Hinderer at ens-lyon.org> wrote:
> It seems the virtual consoles do not (yet?) have the capacity to
> distinguish e.g. Enter from Contro-Enter, combine shift with tabl,
> control or the arrow keys.
I have had an intention to write about this and to continue the discussion we
started with Nicolas.
> I am wondering whether such limitations are intrinsic to the console and
> thus impossible to overcome for some reason, or whether it's just
> that the support for such key combinations has not been implemented
> yet and could be added?
Of course console keyboard support can be enhanced.
You can already get quite far by:
1) Defining your own keymap (you need to define your own function key
strings),
2) Configuring console programs to understand the new key combinations (this
is not always possible without editing the programs' source code)
However, the number of configurable function key strings in Linux console is
255, which puts a hard limit on the number of possible key combinations.
Also, as the terminal strings for advanced key combinations are not included
in any Linux terminal descriptions, you either need to add those descriptions
to terminfo and in some cases reconfigure/modify programs to understand them.
Some graphical terminal emulators, like Xterm and (most notably) kitty,
support very advanced key combination handling. They allow the program running
in terminal to request for extended key information, which allows detecting
key combinations like Shift+Esc, CTRL+Shift+3 or Alt+Shift+Space, which
normally don't have a representation in terminal.
Newest tmux also supports a part of this extended keyboard input. Terminal
access library called notcurses also has an implementation for parsing the
extended terminal CSI sequences.
Unfortunately there is no any kind of standard and the system is not well
documented. Use your chosen search engine to to find information about
extended terminal keyboard input—resources are scattered across the net.
So the path forward is kind of open, but how Linux console should implement
the forming standard is a totally open question.
--
Aura
More information about the BRLTTY
mailing list