summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatar Tom Willemse2025-09-01 23:07:14 -0700
committerGravatar Tom Willemse2025-09-01 23:07:14 -0700
commitca9004e5fab51f1d0a8deb7240f4136ecf76ba8a (patch)
treeec2d537894e47792741abf47b379a641814716d2
parent482112bef437de50a80f2c7f8bf467e771a220a5 (diff)
downloadxkbcat-ca9004e5fab51f1d0a8deb7240f4136ecf76ba8a.tar.gz
xkbcat-ca9004e5fab51f1d0a8deb7240f4136ecf76ba8a.zip
Skip any normal letter keys
I want to know specifically which keys I use the most that _aren't_ just letters. I have a keyboard layout that I like just fine, but I want to know which special keys I actually use the most.
-rw-r--r--xkbcat.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xkbcat.c b/xkbcat.c
index 762c394..b7be2aa 100644
--- a/xkbcat.c
+++ b/xkbcat.c
@@ -3,6 +3,9 @@
#include <X11/XKBlib.h>
#include <X11/extensions/XInput2.h>
+#define XK_LATIN1
+#include <X11/keysymdef.h>
+
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -145,6 +148,11 @@ int main(int argc, char *argv[]) {
continue;
}
}
+
+ if ((s >= XK_A && s <= XK_Z) || (s >= XK_a && s <= XK_z)) {
+ continue;
+ }
+
char *str = XKeysymToString(s);
if (NULL == str)
continue;