Add just pressed buttons
This commit is contained in:
parent
2380fbee6d
commit
861bc195d7
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user