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);