latch input

This commit is contained in:
Nilton Constantino
2026-01-16 06:28:47 +00:00
parent fd31b7b7f9
commit 19241b7d41
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ pub struct Button {
impl Button {
pub fn begin_frame(&mut self, is_down_now: bool) {
let was_down = self.down;
self.down = is_down_now;
self.down = is_down_now.clone();
self.pressed = !was_down && self.down;
self.released = was_down && !self.down;