summaryrefslogtreecommitdiffstats
path: root/xlnch.c
diff options
context:
space:
mode:
authoranastasisg <anastasis@learnworlds.com>2025-02-12 00:44:47 +0200
committeranastasisg <anastasis@learnworlds.com>2025-02-12 00:44:47 +0200
commiteb921aa2931859f55b11f3cc42a7fadd147a58d9 (patch)
treec41a0d9788a138c9272702674aaa998acca181c0 /xlnch.c
parent60d890c9e9ba5d374c238647561ce23fa23bc431 (diff)
downloadxlnch-eb921aa2931859f55b11f3cc42a7fadd147a58d9.tar.gz
xlnch-eb921aa2931859f55b11f3cc42a7fadd147a58d9.tar.bz2
xlnch-eb921aa2931859f55b11f3cc42a7fadd147a58d9.zip
keysym to ignore layoutHEADmaster
Diffstat (limited to 'xlnch.c')
-rw-r--r--xlnch.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/xlnch.c b/xlnch.c
index a5ffd62..f39f606 100644
--- a/xlnch.c
+++ b/xlnch.c
@@ -302,11 +302,16 @@ int run()
return 0;
}
- XLookupString(&event.xkey, text, 255, &keysym, 0);
- flag = 0;
-
for (unsigned int i = 0; i < idx; i++) {
- if (lnch[i].key == text[0]) {
+ char tmp[128] = "";
+ // get configured key
+ tmp[0] = lnch[i].key;
+ tmp[1] = '\0';
+ // convert to keysym, and then to keycode Keycodes are consistent
+ // across layouts but may vary between different keyboard models.
+ // For example, the keycode for the "A" key might differ between
+ // a US QWERTY keyboard and a French AZERTY keyboard.
+ if (XKeysymToKeycode(display, XStringToKeysym(tmp)) == event.xkey.keycode) {
rc = run_cmd(lnch[i].cmd);
flag = 1;
if (lnch[i].exits) {