From 861bc195d7465652d709acc787b03eccce610ac8 Mon Sep 17 00:00:00 2001 From: Sofia Date: Fri, 29 May 2026 21:56:23 +0300 Subject: [PATCH] Add just pressed buttons --- src/async_io.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/async_io.rs b/src/async_io.rs index c2d6f40..b513fe5 100644 --- a/src/async_io.rs +++ b/src/async_io.rs @@ -85,6 +85,13 @@ impl Keypad { }) } + pub fn just_pressed_buttons(&self) -> BTreeSet { + critical_section::with(|cs| { + let presses = self.presses.borrow_ref(cs); + presses.keys().copied().collect() + }) + } + pub fn clear(&self) { critical_section::with(|cs| { let mut presses = self.presses.borrow_ref_mut(cs);