mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
terminal/idev: don't remove consumed-mods from kbd-matches
XKB consumed mods include modifiers that *didn't* affect the translation, but might affect it if used. This is very misleading, given that we are usually not interested in that information. Therefore, keep them in real mods to behave like X11 does. Maybe at some point, XKB introduces proper shortcut matching... Also make evcat display consumed modifiers so we can better debug those situations.
This commit is contained in:
parent
34dbefceb1
commit
62d5068d63
@ -219,6 +219,13 @@ static void kdata_print(idev_data *data) {
|
||||
printf(" %-5s", (k->mods & IDEV_KBDMOD_LINUX) ? "LINUX" : "");
|
||||
printf(" %-4s", (k->mods & IDEV_KBDMOD_CAPS) ? "CAPS" : "");
|
||||
|
||||
/* Consumed modifiers */
|
||||
printf(" | %-5s", (k->consumed_mods & IDEV_KBDMOD_SHIFT) ? "SHIFT" : "");
|
||||
printf(" %-4s", (k->consumed_mods & IDEV_KBDMOD_CTRL) ? "CTRL" : "");
|
||||
printf(" %-3s", (k->consumed_mods & IDEV_KBDMOD_ALT) ? "ALT" : "");
|
||||
printf(" %-5s", (k->consumed_mods & IDEV_KBDMOD_LINUX) ? "LINUX" : "");
|
||||
printf(" %-4s", (k->consumed_mods & IDEV_KBDMOD_CAPS) ? "CAPS" : "");
|
||||
|
||||
/* Resolved symbols */
|
||||
printf(" |");
|
||||
for (i = 0; i < k->n_syms; ++i) {
|
||||
|
@ -123,7 +123,7 @@ static inline bool idev_kbdmatch(idev_data_keyboard *kdata,
|
||||
return false;
|
||||
|
||||
real = kdata->mods & ~kdata->consumed_mods & significant;
|
||||
if (real != (mods & ~kdata->consumed_mods))
|
||||
if (real != mods)
|
||||
return false;
|
||||
|
||||
return !memcmp(syms, kdata->keysyms, n_syms * sizeof(*syms));
|
||||
|
Loading…
Reference in New Issue
Block a user