diff --git a/druid-shell/src/text.rs b/druid-shell/src/text.rs index be475516b1..4c5db26c2c 100644 --- a/druid-shell/src/text.rs +++ b/druid-shell/src/text.rs @@ -403,6 +403,7 @@ pub fn simulate_input( event: KeyEvent, ) -> bool { if handler.key_down(event.clone()) { + eprintln!("key handled, returning early"); return true; } @@ -450,6 +451,26 @@ pub fn simulate_input( input_handler.handle_action(Action::Move(movement)); } } + KbKey::Backspace => { + input_handler.handle_action(Action::Delete(Movement::Grapheme(Direction::Upstream))); + } + KbKey::Enter => { + // I'm sorry windows, you'll get IME soon. + input_handler.handle_action(Action::InsertNewLine { + ignore_hotkey: false, + newline_type: '\n', + }); + } + KbKey::Tab => { + let action = if event.mods.shift() { + Action::InsertBacktab + } else { + Action::InsertTab { + ignore_hotkey: false, + } + }; + input_handler.handle_action(action); + } _ => { handler.release_input_lock(token); return false;