From 9e85093a6dc164da3c605b27336a0197252e688d Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Wed, 14 Sep 2022 21:30:04 +0000 Subject: [PATCH] keyboard: Prefer lower keycodes Xwayland can't handle keycodes above 255, so in order to play nice with X11, we try to use the lowest possible keycode that's applicable for the given shift level. Fixes #148 --- src/keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/keyboard.c b/src/keyboard.c index 1663653..79fb1f3 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -91,7 +91,7 @@ static int compare_symbols(const void* a, const void* b) const struct table_entry* y = b; if (x->symbol == y->symbol) - return x->level < y->level ? -1 : x->level > y->level; + return x->code < y->code ? -1 : x->code > y->code; return x->symbol < y->symbol ? -1 : x->symbol > y->symbol; }