From 0fd299d995d4f244a4362f50e6f7d67cf6bed7a8 Mon Sep 17 00:00:00 2001 From: vzex Date: Fri, 17 Dec 2021 11:14:29 +0800 Subject: [PATCH] fix macos dead key after typing dead key, there is also an ime event triggered,so get text_with_all_modifiers is unnecessary --- src/window/keyboard_manager.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/window/keyboard_manager.rs b/src/window/keyboard_manager.rs index 04b4de5..5ac6574 100644 --- a/src/window/keyboard_manager.rs +++ b/src/window/keyboard_manager.rs @@ -1,8 +1,6 @@ use glutin::event::{ElementState, Event, KeyEvent, WindowEvent}; use glutin::keyboard::Key; -use glutin::platform::modifier_supplement::KeyEventExtModifierSupplement; - use crate::bridge::{SerialCommand, UiCommand}; use crate::event_aggregator::EVENT_AGGREGATOR; use crate::settings::SETTINGS; @@ -118,13 +116,7 @@ impl KeyboardManager { if let Some(key_text) = is_control_key(key_event.logical_key) { Some(self.format_keybinding_string(true, true, key_text)) } else { - let is_dead_key = - key_event.text_with_all_modifiers().is_some() && key_event.text.is_none(); - let key_text = if (self.alt || is_dead_key) && cfg!(target_os = "macos") { - key_event.text_with_all_modifiers() - } else { - key_event.text - }; + let key_text = key_event.text; if let Some(key_text) = key_text { // This is not a control key, so we rely upon winit to determine if