layout: Improve press handling
Makes it more similar to release handling, removes some redundant checks. This makes it easier to integrate modifiers in the future.
This commit is contained in:
@ -46,6 +46,14 @@ impl KeyState {
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn into_pressed(self) -> KeyState {
|
||||
KeyState {
|
||||
pressed: PressType::Pressed,
|
||||
..self
|
||||
}
|
||||
}
|
||||
|
||||
/// KeyStates instances are the unique identifiers of pressed keys,
|
||||
/// and the actions submitted with them.
|
||||
pub fn get_id(keystate: &Rc<RefCell<KeyState>>) -> KeyStateId {
|
||||
|
||||
Reference in New Issue
Block a user