diff options
Diffstat (limited to 'graphics/src')
| -rw-r--r-- | graphics/src/lib.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/graphics/src/lib.rs b/graphics/src/lib.rs index 25b4287..b021cc6 100644 --- a/graphics/src/lib.rs +++ b/graphics/src/lib.rs @@ -161,11 +161,16 @@ impl Window { self.handle.borrow().get_frame_time() } - /// Returns if the provided `KeyCode` has been pressed once + /// Returns if the provided `KeyCode` has just been pressed pub fn is_key_pressed(&self, key: KeyCode) -> bool { self.handle.borrow().is_key_pressed(key) } + /// Returns if the provided `KeyCode` has just been released + pub fn is_key_released(&self, key: KeyCode) -> bool { + self.handle.borrow().is_key_released(key) + } + /// Returns if the provided `KeyCode` is NOT currently pressed pub fn is_key_up(&self, key: KeyCode) -> bool { self.handle.borrow().is_key_up(key) |