text_box: Do not attempt to insert control characters
This commit is contained in:
parent
a71166383a
commit
02a093be0e
1 changed files with 2 additions and 5 deletions
|
|
@ -431,11 +431,8 @@ where
|
||||||
Event::Keyboard(KeyEvent::CharacterReceived(character)) => {
|
Event::Keyboard(KeyEvent::CharacterReceived(character)) => {
|
||||||
// Only parse keys when Super, Ctrl, and Alt are not pressed
|
// Only parse keys when Super, Ctrl, and Alt are not pressed
|
||||||
if !state.modifiers.logo() && !state.modifiers.control() && !state.modifiers.alt() {
|
if !state.modifiers.logo() && !state.modifiers.control() && !state.modifiers.alt() {
|
||||||
match character {
|
if !character.is_control() {
|
||||||
'\n' | '\r' | '\t' => {}
|
editor.action(Action::Insert(character));
|
||||||
_ => {
|
|
||||||
editor.action(Action::Insert(character));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
status = Status::Captured;
|
status = Status::Captured;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue