pub struct KeyCharacterMap { /* private fields */ }Expand description
Describes the keys provided by a keyboard device and their associated labels.
Implementations§
Source§impl KeyCharacterMap
impl KeyCharacterMap
Sourcepub fn get(
&self,
key_code: Keycode,
meta_state: MetaState,
) -> Result<KeyMapChar, AppError>
pub fn get( &self, key_code: Keycode, meta_state: MetaState, ) -> Result<KeyMapChar, AppError>
Gets the Unicode character generated by the specified Keycode and MetaState combination.
Returns KeyMapChar::None if the key is not one that is used to type Unicode characters.
Returns KeyMapChar::CombiningAccent if the key is a “dead key” that should be combined with
another to actually produce a character – see KeyCharacterMap::get_dead_char.
§Errors
Since this API needs to use JNI internally to call into the Android JVM it may return
a AppError::JavaError in case there is a spurious JNI error or an exception
is caught.
Sourcepub fn get_dead_char(
&self,
accent_char: char,
base_char: char,
) -> Result<Option<char>, AppError>
pub fn get_dead_char( &self, accent_char: char, base_char: char, ) -> Result<Option<char>, AppError>
Get the character that is produced by combining the dead key producing accent with the key producing character c.
For example, get_dead_char('`', 'e') returns ‘è’. get_dead_char('^', ' ') returns ‘^’ and get_dead_char('^', '^') returns ‘^’.
§Errors
Since this API needs to use JNI internally to call into the Android JVM it may return
a AppError::JavaError in case there is a spurious JNI error or an exception
is caught.
Sourcepub fn get_keyboard_type(&self) -> Result<KeyboardType, AppError>
pub fn get_keyboard_type(&self) -> Result<KeyboardType, AppError>
Gets the keyboard type.
Different keyboard types have different semantics. See KeyboardType for details.
§Errors
Since this API needs to use JNI internally to call into the Android JVM it may return
a AppError::JavaError in case there is a spurious JNI error or an exception
is caught.
Trait Implementations§
Source§impl Clone for KeyCharacterMap
impl Clone for KeyCharacterMap
Source§fn clone(&self) -> KeyCharacterMap
fn clone(&self) -> KeyCharacterMap
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more