]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
vt: add modifier support to cursor keys
authorNicolas Pitre <npitre@baylibre.com>
Tue, 3 Feb 2026 04:52:46 +0000 (23:52 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2026 14:07:51 +0000 (15:07 +0100)
commit4af70f151671da6acd7a1d7bae1469c576673d2d
tree4cb2e834bfc2032df2c66720ed2809db16098165
parent24728b93fafe0949b5353e1a7b3a94175fe26d6e
vt: add modifier support to cursor keys

Generate xterm-style CSI sequences with modifier parameters for arrow
keys when Shift, Alt, or Ctrl are held. For example, Shift+Up produces
ESC [ 1 ; 2 A instead of plain ESC [ A.

The modifier encoding follows the standard xterm convention:
  mod = 1 + (shift ? 1 : 0) + (alt ? 2 : 0) + (ctrl ? 4 : 0)

When no modifiers are pressed, the original behavior is preserved.

Explicit keymap bindings for modified cursor keys (e.g., "shift keycode
103 = Find") take precedence over this automatic modifier encoding.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
Link: https://patch.msgid.link/20260203045457.1049793-2-nico@fluxnic.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/keyboard.c