|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From 62d5068d631fd655efe3ae4ad51fffe28e13e27a Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
From: David Herrmann <dh.herrmann@gmail.com>
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Date: Sun, 5 Oct 2014 17:44:09 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Subject: [PATCH] terminal/idev: don't remove consumed-mods from kbd-matches
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
XKB consumed mods include modifiers that *didn't* affect the translation,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
but might affect it if used. This is very misleading, given that we are
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
usually not interested in that information. Therefore, keep them in real
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
mods to behave like X11 does. Maybe at some point, XKB introduces proper
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
shortcut matching...
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
Also make evcat display consumed modifiers so we can better debug those
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
situations.
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/evcat.c | 7 +++++++
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
src/libsystemd-terminal/idev.h | 2 +-
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
2 files changed, 8 insertions(+), 1 deletion(-)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/evcat.c b/src/libsystemd-terminal/evcat.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index 62556f6a2b..9e8a262b79 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/evcat.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/evcat.c
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -219,6 +219,13 @@ static void kdata_print(idev_data *data) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
printf(" %-5s", (k->mods & IDEV_KBDMOD_LINUX) ? "LINUX" : "");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
printf(" %-4s", (k->mods & IDEV_KBDMOD_CAPS) ? "CAPS" : "");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ /* Consumed modifiers */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ printf(" | %-5s", (k->consumed_mods & IDEV_KBDMOD_SHIFT) ? "SHIFT" : "");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ printf(" %-4s", (k->consumed_mods & IDEV_KBDMOD_CTRL) ? "CTRL" : "");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ printf(" %-3s", (k->consumed_mods & IDEV_KBDMOD_ALT) ? "ALT" : "");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ printf(" %-5s", (k->consumed_mods & IDEV_KBDMOD_LINUX) ? "LINUX" : "");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ printf(" %-4s", (k->consumed_mods & IDEV_KBDMOD_CAPS) ? "CAPS" : "");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
/* Resolved symbols */
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
printf(" |");
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
for (i = 0; i < k->n_syms; ++i) {
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
diff --git a/src/libsystemd-terminal/idev.h b/src/libsystemd-terminal/idev.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
index ea79bb6ab6..c8c03f3d41 100644
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
--- a/src/libsystemd-terminal/idev.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+++ b/src/libsystemd-terminal/idev.h
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
@@ -123,7 +123,7 @@ static inline bool idev_kbdmatch(idev_data_keyboard *kdata,
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return false;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
real = kdata->mods & ~kdata->consumed_mods & significant;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
- if (real != (mods & ~kdata->consumed_mods))
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
+ if (real != mods)
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return false;
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
|
|
Zbigniew Jędrzejewski-Szmek |
62fe94 |
return !memcmp(syms, kdata->keysyms, n_syms * sizeof(*syms));
|