From 1992b22ca13ba75c287ee5c62d1be8bc277923b1 Mon Sep 17 00:00:00 2001 From: Richard Acayan Date: Mon, 12 Aug 2024 19:16:33 -0400 Subject: [PATCH] core: button: only emit modifier keys that do not change the layout Most future modifier keys will be accents that wouldn't be represented with an actual key press. Only emit modifier keys as key presses if they are of the other type (Ctrl, Alt, Shift). --- src/core/button.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/button.rs b/src/core/button.rs index fcf4361..6ad2c04 100644 --- a/src/core/button.rs +++ b/src/core/button.rs @@ -239,11 +239,11 @@ impl Button { if self.modifiers[modifier - 1] == old { self.modifiers[modifier - 1] = new; - if new == ModState::Released { + if new == ModState::Released && !Layout::is_keysym_modifier(modifier) { self.kbd.release(Layout::modifier_keysym(modifier)); } - if old == ModState::Released { + if old == ModState::Released && !Layout::is_keysym_modifier(modifier) { self.kbd.press(Layout::modifier_keysym(modifier)); }