diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2021-01-18 11:37:39 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2021-02-08 14:52:02 +1000 |
commit | 5dbb5b76597f434ec91cfcde0750de8157c0bbf5 (patch) | |
tree | 568e8056be50e0b096c70191fd8d5df3f0f9a94b /README.md | |
parent | 70e990f09c54033097ed21caebf0dc73ec738aaf (diff) |
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>
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -32,3 +32,27 @@ For patch submission instructions, see: https://www.x.org/wiki/Development/Documentation/SubmittingPatches + +Updating for new Linux kernel releases +-------------------------------------- + +The XF86keysym.h header file needs updating whenever the Linux kernel +adds a new keycode to linux/input-event-codes.h. See the comment in +include/X11/XF86keysym.h for details on the format. + +The steps to update the file are: + +- if the kernel release did not add new `KEY_FOO` defines, no work is + required +- ensure that libevdev has been updated to the new kernel headers. This may + require installing libevdev from git. +- run `scripts/keysym-generator.py` to add new keysyms. See the `--help` + output for the correct invocation. +- verify that the format for any keys added by this script is correct and + that the keys need to be mapped. Where a key code should not get a new + define or is already defined otherwise, comment the line. +- file a merge request with the new changes +- notify the xkeyboard-config maintainers that updates are needed + +Note that any #define added immediately becomes API. Due diligence is +recommended. |