pub struct Keypad { /* private fields */ }Expand description
The keypad layout - a 5x4 grid of buttons
[ 7 ] [ 8 ] [ 9 ] [ / ]
[ 4 ] [ 5 ] [ 6 ] [ * ]
[ 1 ] [ 2 ] [ 3 ] [ - ]
[ 0 ] [ . ] [ = ] [ + ]
[ C ] [ ( ] [ ) ] [ ^ ]Implementations§
Source§impl Keypad
impl Keypad
Returns the number of buttons
Sourcepub fn dimensions(&self) -> (usize, usize)
pub fn dimensions(&self) -> (usize, usize)
Returns the grid dimensions (rows, cols)
Gets a button by index
Gets a mutable button by index
Gets a button by row and column
Finds a button by its label character
Finds a button by the character it would insert
Sets a button as pressed by index
Sourcepub fn release_all(&mut self)
pub fn release_all(&mut self)
Releases all buttons
Sourcepub fn highlight_char(&mut self, ch: char)
pub fn highlight_char(&mut self, ch: char)
Highlights the button corresponding to a character
Returns an iterator over all buttons
Returns an iterator over buttons with their (row, col) positions
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Keypad
impl RefUnwindSafe for Keypad
impl Send for Keypad
impl Sync for Keypad
impl Unpin for Keypad
impl UnsafeUnpin for Keypad
impl UnwindSafe for Keypad
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more