From 5aeb3b937ba5a7031db79781fa79802c39cc830d Mon Sep 17 00:00:00 2001 From: Carter Anderson Date: Thu, 4 Jun 2020 23:57:39 -0700 Subject: [PATCH] add "pressed" example to mouse_input --- examples/input/mouse_input.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/input/mouse_input.rs b/examples/input/mouse_input.rs index 427552f043..2f11148797 100644 --- a/examples/input/mouse_input.rs +++ b/examples/input/mouse_input.rs @@ -9,11 +9,15 @@ fn main() { // This system prints messages when you press or release the left mouse button: fn mouse_click_system(mouse_button_input: Res>) { + if mouse_button_input.pressed(MouseButton::Left) { + println!("left mouse currently pressed"); + } + if mouse_button_input.just_pressed(MouseButton::Left) { - println!("left mouse clicked"); + println!("left mouse just pressed"); } if mouse_button_input.just_released(MouseButton::Left) { - println!("left mouse released"); + println!("left mouse just released"); } }