Struct android_activity::input::KeyCharacterMap
source · 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