diff options
author | wm4 <wm4@nowhere> | 2015-02-13 21:42:39 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-02-13 21:47:22 +0100 |
commit | 417869f845d34596d8651fd9c38e6c74d56fecee (patch) | |
tree | b5c6c6c4da109f4fe10a777bfc0d7a5feab5bf15 /video/out | |
parent | 32b56c56bad78d8d3038361aef6f36ad9cabebb0 (diff) |
x11: make all XF86 special keys mappable
Makes all keys documented in XF86keysym.h mappable. This requires the
user to deal with numeric keycodes; no names are queried or exported.
This is an easy way to avoid adding all the hundreds of XF86 keys to
our X11 lookup table and mpv's keycode/name list.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/x11_common.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 0e02069ae6..1f933bfcae 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -611,6 +611,13 @@ static int vo_x11_lookupkey(int key) if (!mpkey) mpkey = lookup_keymap_table(keymap, key); + // XFree86 keysym range; typically contains obscure "extra" keys + if (!mpkey && key >= 0x10080001 && key <= 0x1008FFFF) { + mpkey = MP_KEY_UNKNOWN_RESERVED_START + (key - 0x10080000); + if (mpkey > MP_KEY_UNKNOWN_RESERVED_LAST) + mpkey = 0; + } + return mpkey; } |