fix: handle space input as text
This commit is contained in:
parent
64740c1b89
commit
c9ebbd59b0
1 changed files with 3 additions and 6 deletions
|
|
@ -696,7 +696,7 @@ where
|
||||||
key: Key::Named(key),
|
key: Key::Named(key),
|
||||||
modifiers,
|
modifiers,
|
||||||
..
|
..
|
||||||
}) if state.is_focused => match key {
|
}) if state.is_focused && !matches!(key, Named::Space) => match key {
|
||||||
Named::ArrowLeft => {
|
Named::ArrowLeft => {
|
||||||
editor.action(Action::Motion(Motion::Left));
|
editor.action(Action::Motion(Motion::Left));
|
||||||
status = Status::Captured;
|
status = Status::Captured;
|
||||||
|
|
@ -758,11 +758,8 @@ where
|
||||||
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
|
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
|
||||||
state.modifiers = modifiers;
|
state.modifiers = modifiers;
|
||||||
}
|
}
|
||||||
Event::Keyboard(KeyEvent::KeyPressed {
|
Event::Keyboard(KeyEvent::KeyPressed { text, .. }) if state.is_focused => {
|
||||||
key: Key::Character(character),
|
let character = text.unwrap_or_default().chars().next().unwrap_or_default();
|
||||||
..
|
|
||||||
}) if state.is_focused => {
|
|
||||||
let character = character.chars().next().unwrap_or_default();
|
|
||||||
// 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() {
|
||||||
if !character.is_control() {
|
if !character.is_control() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue