diff options
author | anastasisg <anastasis@learnworlds.com> | 2025-02-12 00:44:47 +0200 |
---|---|---|
committer | anastasisg <anastasis@learnworlds.com> | 2025-02-12 00:44:47 +0200 |
commit | eb921aa2931859f55b11f3cc42a7fadd147a58d9 (patch) | |
tree | c41a0d9788a138c9272702674aaa998acca181c0 /xlnch.c | |
parent | 60d890c9e9ba5d374c238647561ce23fa23bc431 (diff) | |
download | xlnch-eb921aa2931859f55b11f3cc42a7fadd147a58d9.tar.gz xlnch-eb921aa2931859f55b11f3cc42a7fadd147a58d9.tar.bz2 xlnch-eb921aa2931859f55b11f3cc42a7fadd147a58d9.zip |
Diffstat (limited to 'xlnch.c')
-rw-r--r-- | xlnch.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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) { |