From f1e0a47f25a323e123c0f6ed063fb425556fb8fc Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 27 Jan 2024 08:07:33 -0800 Subject: [PATCH] Minor edit --- crates/playeragent/src/inputstatus.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/playeragent/src/inputstatus.rs b/crates/playeragent/src/inputstatus.rs index a85187f..4159b7d 100644 --- a/crates/playeragent/src/inputstatus.rs +++ b/crates/playeragent/src/inputstatus.rs @@ -16,7 +16,7 @@ pub struct InputStatus { key_guns: bool, key_leftclick: bool, - // One-shot keys (audomatically released at the end of each frame) + // One-shot keys (automatically released at the end of each frame) key_land: bool, v_scroll: f32, } @@ -137,6 +137,11 @@ impl InputStatus { self.key_guns } + /// Is the player pressing the left mouse button? + pub fn pressed_leftclick(&self) -> bool { + self.key_leftclick + } + /// Has the player pressed the "land" key? /// (One-shot, reset to false at the start of each frame) pub fn pressed_land(&self) -> bool {