fix another type of dead key input

macos-click-through
vzex 3 years ago committed by Keith Simmons
parent 0fd299d995
commit feae712bae

@ -1,6 +1,8 @@
use glutin::event::{ElementState, Event, KeyEvent, WindowEvent}; use glutin::event::{ElementState, Event, KeyEvent, WindowEvent};
use glutin::keyboard::Key; use glutin::keyboard::Key;
use glutin::platform::modifier_supplement::KeyEventExtModifierSupplement;
use crate::bridge::{SerialCommand, UiCommand}; use crate::bridge::{SerialCommand, UiCommand};
use crate::event_aggregator::EVENT_AGGREGATOR; use crate::event_aggregator::EVENT_AGGREGATOR;
use crate::settings::SETTINGS; use crate::settings::SETTINGS;
@ -117,8 +119,11 @@ impl KeyboardManager {
Some(self.format_keybinding_string(true, true, key_text)) Some(self.format_keybinding_string(true, true, key_text))
} else { } else {
let key_text = key_event.text; let key_text = key_event.text;
if let Some(ori_key_text) = key_text {
if let Some(key_text) = key_text { let mut key_text = ori_key_text;
if let Some(modify) = key_event.text_with_all_modifiers() {
key_text = modify;
}
// This is not a control key, so we rely upon winit to determine if // This is not a control key, so we rely upon winit to determine if
// this is a deadkey or not. // this is a deadkey or not.
let keybinding_string = if let Some(escaped_text) = is_special(key_text) { let keybinding_string = if let Some(escaped_text) = is_special(key_text) {

Loading…
Cancel
Save