diff options
| author | Yusuf Elsharawy <yusufse-2004@hotmail.com> | 2025-11-10 20:05:46 +0000 |
|---|---|---|
| committer | Yusuf Elsharawy <yusufse-2004@hotmail.com> | 2025-11-10 20:10:38 +0000 |
| commit | b1c7a57e72ab7359191249d76ec84d6cae524e2a (patch) | |
| tree | c533911f87b1641d893de5ab68ed05c2558b1cba /graphics | |
| parent | graphics: decouple sdl & wayland (diff) | |
| download | DungeonCrawl-b1c7a57e72ab7359191249d76ec84d6cae524e2a.tar.gz DungeonCrawl-b1c7a57e72ab7359191249d76ec84d6cae524e2a.tar.bz2 DungeonCrawl-b1c7a57e72ab7359191249d76ec84d6cae524e2a.zip | |
Refactored some code, implemented player movement
Diffstat (limited to 'graphics')
| -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) |