From 9ac860b817a409245f57fff76cfcb5c98d2ad7e2 Mon Sep 17 00:00:00 2001 From: sleich Date: Wed, 8 Jan 2020 04:47:57 +0300 Subject: [PATCH] Add Ctrl-[ shortcut to x11 and wayland Ctrl-[ shortcut is used to quit bemenu. It already works with ncurses backend --- lib/renderers/wayland/wayland.c | 2 ++ lib/renderers/x11/x11.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/renderers/wayland/wayland.c b/lib/renderers/wayland/wayland.c index 572b994..866c94e 100644 --- a/lib/renderers/wayland/wayland.c +++ b/lib/renderers/wayland/wayland.c @@ -124,6 +124,8 @@ poll_key(const struct bm_menu *menu, unsigned int *unicode) case XKB_KEY_g: if (!(mods & MOD_CTRL)) return BM_KEY_UNICODE; + case XKB_KEY_bracketleft: + if (!(mods & MOD_CTRL)) return BM_KEY_UNICODE; case XKB_KEY_Escape: return BM_KEY_ESCAPE; diff --git a/lib/renderers/x11/x11.c b/lib/renderers/x11/x11.c index 0b5c401..ede90a2 100644 --- a/lib/renderers/x11/x11.c +++ b/lib/renderers/x11/x11.c @@ -103,6 +103,8 @@ poll_key(const struct bm_menu *menu, unsigned int *unicode) case XK_g: if (!(mods & MOD_CTRL)) return BM_KEY_UNICODE; + case XK_bracketleft: + if (!(mods & MOD_CTRL)) return BM_KEY_UNICODE; case XK_Escape: return BM_KEY_ESCAPE;