Add just pressed buttons

This commit is contained in:
Sofia 2026-05-29 21:56:23 +03:00
parent 2380fbee6d
commit 861bc195d7

View File

@ -85,6 +85,13 @@ impl Keypad {
})
}
pub fn just_pressed_buttons(&self) -> BTreeSet<KeypadButton> {
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);