mewhhaha 5 years ago
parent f3f441bb86
commit 82dd785a26

@ -126,18 +126,18 @@ impl WindowWrapper {
pub fn handle_key_down(&mut self, keycode: Keycode, modifiers: Mod) { pub fn handle_key_down(&mut self, keycode: Keycode, modifiers: Mod) {
trace!("KeyDown Received: {}", keycode); trace!("KeyDown Received: {}", keycode);
const ALTGR: Mod = Mod::from_bits_truncate(0x0240);
if let Some((key_text, special)) = parse_keycode(keycode) { if let Some((key_text, special)) = parse_keycode(keycode) {
let will_text_input = let ctrl = modifiers.contains(Mod::LCTRLMOD) || modifiers.contains(Mod::RCTRLMOD);
modifiers.contains(ALTGR) || let alt = modifiers.contains(Mod::LALTMOD) || modifiers.contains(Mod::RALTMOD);
!modifiers.contains(Mod::LCTRLMOD) && let gui = modifiers.contains(Mod::LGUIMOD) || modifiers.contains(Mod::RGUIMOD);
!modifiers.contains(Mod::RCTRLMOD) &&
!modifiers.contains(Mod::LALTMOD) && let will_text_input =
!modifiers.contains(Mod::RALTMOD) && modifiers.contains(Mod::MODEMOD) ||
!modifiers.contains(Mod::LGUIMOD) && (ctrl && alt) ||
!modifiers.contains(Mod::RGUIMOD); !ctrl && !alt && !gui;
if modifiers.contains(Mod::MODEMOD) || (will_text_input && !special) {
if will_text_input && !special {
self.ignore_text_input = false; self.ignore_text_input = false;
return; return;
} }

Loading…
Cancel
Save