pub struct WasmKeypad { /* private fields */ }Expand description
WASM Keypad layout definition Layout:
[ 7 ] [ 8 ] [ 9 ] [ / ]
[ 4 ] [ 5 ] [ 6 ] [ * ]
[ 1 ] [ 2 ] [ 3 ] [ - ]
[ 0 ] [ . ] [ = ] [ + ]
[ C ] [ ( ] [ ) ] [ ^ ]Implementations§
Source§impl WasmKeypad
impl WasmKeypad
Returns the number of buttons
Sourcepub fn dimensions(&self) -> (usize, usize)
pub fn dimensions(&self) -> (usize, usize)
Returns the grid dimensions (rows, cols)
Gets all button definitions
Gets a button by index
Gets a button by row and column
Finds a button by element ID
Finds a button by the character it inserts
Sourcepub fn create_dom_elements(&self) -> Vec<DomElement>
pub fn create_dom_elements(&self) -> Vec<DomElement>
Creates DOM elements for all keypad buttons
Sourcepub fn create_keypad_element(&self) -> DomElement
pub fn create_keypad_element(&self) -> DomElement
Creates a keypad container element with all buttons
Sourcepub fn handle_click(&self, element_id: &str) -> Option<KeypadAction>
pub fn handle_click(&self, element_id: &str) -> Option<KeypadAction>
Processes a button click event and returns the action
Sourcepub fn key_to_action(key: &str) -> Option<KeypadAction>
pub fn key_to_action(key: &str) -> Option<KeypadAction>
Maps a keyboard key to a keypad action
Trait Implementations§
Source§impl Clone for WasmKeypad
impl Clone for WasmKeypad
Source§fn clone(&self) -> WasmKeypad
fn clone(&self) -> WasmKeypad
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WasmKeypad
impl Debug for WasmKeypad
Auto Trait Implementations§
impl Freeze for WasmKeypad
impl RefUnwindSafe for WasmKeypad
impl Send for WasmKeypad
impl Sync for WasmKeypad
impl Unpin for WasmKeypad
impl UnsafeUnpin for WasmKeypad
impl UnwindSafe for WasmKeypad
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