feat: migrate to glam whenever relevant + migrate testbed to kiss3d instead of bevy + release v0.32.0 (#909)
* feat: migrate to glam whenever relevant + migrate testbed to kiss3d instead of bevy * chore: update changelog * Fix warnings and tests * Release v0.32.0
This commit is contained in:
24
src_testbed/testbed/keys.rs
Normal file
24
src_testbed/testbed/keys.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
//! Keyboard state tracking.
|
||||
|
||||
use kiss3d::event::Key;
|
||||
|
||||
/// Keyboard state
|
||||
#[derive(Default, Clone, Debug)]
|
||||
pub struct KeysState {
|
||||
pub shift: bool,
|
||||
pub ctrl: bool,
|
||||
pub alt: bool,
|
||||
pub pressed_keys: Vec<Key>,
|
||||
}
|
||||
|
||||
impl KeysState {
|
||||
/// Check if a specific key is currently pressed
|
||||
pub fn pressed(&self, key: Key) -> bool {
|
||||
self.pressed_keys.contains(&key)
|
||||
}
|
||||
|
||||
/// Get all currently pressed keys
|
||||
pub fn get_pressed(&self) -> &[Key] {
|
||||
&self.pressed_keys
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user