Commit graph

9 commits

Author SHA1 Message Date
Pierre Le Marre
81931cc0fd keysyms: Add missing evdev keys
- Keys from Linux ≤ 2.6.11. Most are TODOs made explicit.
- Add `XF86XK_MonBrightnessAuto` and make `XF86XK_BrightnessAuto` its
  deprecated alias, for consistency with `XF86XK_BrightnessMin`
- Add `XF86XK_LinkPhone` from Linux 6.14
- Add `XF86XK_PerformanceMode" from Linux 6.17
- Fix and improve the keysym generator script

Co-authored-by: Pierre Le Marre <dev@wismill.eu>
Co-authored-by: Kai Uwe Broulik <kde@privat.broulik.de>
Part-of: <https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/103>
2025-10-08 11:02:50 +02:00
Pierre Le Marre
7fc33fe6d9 keysyms: Add aliases for media keys
Part-of: <https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/93>
2025-07-20 21:27:02 +02:00
Oliver Gerlich
d466a25c87 keysyms: add missing keys that were added in Linux kernel 2.5.26
Some keysyms were renamed compared to their Linux kernel counterparts,
to avoid names that are too ambiguous. Names are inspired by the “HID
usage table for USB”.

Some keys were left unmapped due to their ambiguous function.

Also fixed the keysyms script to handle minor new use cases.

Miscellaneous notes:
- `KEY_CHANNEL`: Described as “Go to the next favorite channel” in the
  Linux RC tables, thus mapped to `XF86XK_NextFavorite`.
- `KEY_PVR`: The accronym means “personal video recorder”, but there
  are multiple comments in the kernel refering to it as “Media Select
  Home”.
- `KEY_MODE`: Described as labelled "MONO/STEREO" with the function
  "Change sound mode" in the Linux RC tables, thus mapped to the more
  explicit `XF86XK_AudioChannelMode`.
- `KEY_DIGITS`: Describe as “Use more than one digit for channel”, it
  denotes various number entry modes that depend on the device, thus
  mapped to the more explicit `XF86XK_NumberEntryMode`, inspired by its
  entry in the CEC protocol.

Resources:
- Linux Remote controller tables:
  https://www.kernel.org/doc/html/v6.14/userspace-api/media/rc/rc-tables.html
- Linux HID key mmappings:
  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/hid/hid-input.c
- HID Usage Tables for USB:
  https://usb.org/sites/default/files/hut1_6.pdf
- Kodi: https://github.com/xbmc/xbmc

Co-authored-by: Oliver Gerlich <oliver.gerlich@gmx.de>
Co-authored-by: Pierre Le Marre <dev@wismill.eu>
Part-of: <https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/93>
2025-07-20 20:39:13 +02:00
Pierre Le Marre
2b9fcd0d95
keysyms headers: Normalize keysyms value format & padding
- Harmonize format by using lower case hexadecimal notation.
- Normalize keysym padding: use spaces instead of tabulations
  with the same amount everywhere.
- Update generator to new format.
2023-09-27 08:59:55 +02:00
Peter Hutterer
559141495b scripts: exit with 77 if python-libevdev is missing
This way we pass make check/ninja test even where the module is not available

See https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/31#note_879823

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-04-16 09:32:15 +10:00
Peter Hutterer
242578ac6e Integrate the keysym verifier into make check
autotools can't pass arguments, so let's default to 'verify' in the script
itself and for distcheck to succeed, we need to set an environment variable to
search for the header (it's an out-of-tree build).

And due to the very faint chance of there being no python during the
xorgproto build, let's make that conditional too.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-03-10 09:39:44 +00:00
Peter Hutterer
e5d8af9711 scripts: make sure all "Use: XK_Foo" comments point to existing symbols
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-17 10:54:14 +10:00
Peter Hutterer
ff19ac58e1 scripts: use a named pattern for the hexcode check in comments
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-17 10:18:19 +10:00
Peter Hutterer
5dbb5b7659 XF86keysym.h: reserve a range for Linux kernel keysyms
The Linux kernel adds a few evdev keycodes roughly every other release. These
aren't available as keysyms through XKB until they have been added as keycode
in xkeyboard-config and mapped there to a newly defined keysym in the X11
proto headers.

In the past, this was done manually,  a suitable keysym was picked at
random and the mapping updated accordingly. This doesn't scale very well and,
given we have a large reserved range for XF86 keysyms anyway, can be done
easier.

Let's reserve the range 0x10081XXX range for a 1:1 mapping of Linux kernel
codes. That's 4095 values, the kernel currently uses only 767 anyway. The
lower 3 bytes of keysyms within that range have to match the kernel value to
make them easy to add and search for. Nothing in X must care about the actual
keysym value anyway.

Since we expect this to be parsed by other scripts for automatic updating, the
format of those #defines is quite strict. Add a script to generate keycodes as
well as verify that the existing ones match the current expected format.

The script is integrated into the CI and meson test, so we will fail if an
update breaks the expectations.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-08 14:52:02 +10:00