Use modiifed_key instead of key, fixes #286
This commit is contained in:
parent
7f1ca9102d
commit
099e32bdc0
1 changed files with 4 additions and 4 deletions
|
|
@ -951,7 +951,7 @@ where
|
|||
let mut status = Status::Ignored;
|
||||
match event {
|
||||
Event::Keyboard(KeyEvent::KeyPressed {
|
||||
key: Key::Named(key),
|
||||
modified_key: Key::Named(key),
|
||||
modifiers,
|
||||
..
|
||||
}) if state.is_focused && !matches!(key, Named::Space) => match key {
|
||||
|
|
@ -1017,9 +1017,6 @@ where
|
|||
}
|
||||
_ => (),
|
||||
},
|
||||
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
|
||||
state.modifiers = modifiers;
|
||||
}
|
||||
Event::Keyboard(KeyEvent::KeyPressed { text, .. }) if state.is_focused => {
|
||||
let character = text.unwrap_or_default().chars().next().unwrap_or_default();
|
||||
// Only parse keys when Super, Ctrl, and Alt are not pressed
|
||||
|
|
@ -1030,6 +1027,9 @@ where
|
|||
status = Status::Captured;
|
||||
}
|
||||
}
|
||||
Event::Keyboard(KeyEvent::ModifiersChanged(modifiers)) => {
|
||||
state.modifiers = modifiers;
|
||||
}
|
||||
Event::Mouse(MouseEvent::ButtonPressed(button)) => {
|
||||
if let Some(p) = cursor_position.position_in(layout.bounds()) {
|
||||
state.is_focused = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue