From 83a5f719d270f54be1854d5dab7610fe4f76ff54 Mon Sep 17 00:00:00 2001 From: Sergey Trofimov Date: Sat, 25 Nov 2023 15:20:36 +0100 Subject: [PATCH] Detect unavailable keys properly. Fixes #592. --- exwm-input.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exwm-input.el b/exwm-input.el index 05b0210..33f19e6 100644 --- a/exwm-input.el +++ b/exwm-input.el @@ -514,7 +514,7 @@ ARGS are additional arguments to CALLBACK." keysyms keycode alt-modifier) (dolist (k exwm-input--global-prefix-keys) (setq keysyms (xcb:keysyms:event->keysyms exwm--connection k)) - (if (not keysyms) + (if (or (not keysyms) (= 0 (caar keysyms))) (warn "Key unavailable: %s" (key-description (vector k))) (setq keycode (xcb:keysyms:keysym->keycode exwm--connection (caar keysyms))) @@ -886,7 +886,7 @@ button event." "Fake a key event equivalent to Emacs event EVENT." (let* ((keysyms (xcb:keysyms:event->keysyms exwm--connection event)) keycode id) - (when (= 0 (caar keysyms)) + (when (or (not keysyms) (= 0 (caar keysyms))) (user-error "[EXWM] Invalid key: %s" (single-key-description event))) (setq keycode (xcb:keysyms:keysym->keycode exwm--connection (caar keysyms)))