pub struct KeyEvent<'a> { /* private fields */ }
Expand description
A key event
For general discussion of key events in Android, see the relevant javadoc.
Implementations§
Source§impl<'a> KeyEvent<'a>
impl<'a> KeyEvent<'a>
Sourcepub fn down_time(&self) -> i64
pub fn down_time(&self) -> i64
Returns the last time the key was pressed. This is on the scale of
java.lang.System.nanoTime()
, which has nanosecond precision, but no defined start time.
See the NDK docs
Sourcepub fn event_time(&self) -> i64
pub fn event_time(&self) -> i64
Returns the time this event occured. This is on the scale of
java.lang.System.nanoTime()
, which has nanosecond precision, but no defined start time.
See the NDK docs
Sourcepub fn key_code(&self) -> Keycode
pub fn key_code(&self) -> Keycode
Returns the keycode associated with this key event
See the NDK docs
Sourcepub fn repeat_count(&self) -> i32
pub fn repeat_count(&self) -> i32
Returns the number of repeats of a key.
See the NDK docs
Sourcepub fn scan_code(&self) -> i32
pub fn scan_code(&self) -> i32
Returns the hardware keycode of a key. This varies from device to device.
See the NDK docs
Sourcepub fn meta_state(&self) -> MetaState
pub fn meta_state(&self) -> MetaState
Returns the state of the modifiers during this key event, represented by a bitmask.
See the NDK docs
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for KeyEvent<'a>
impl<'a> RefUnwindSafe for KeyEvent<'a>
impl<'a> !Send for KeyEvent<'a>
impl<'a> !Sync for KeyEvent<'a>
impl<'a> Unpin for KeyEvent<'a>
impl<'a> UnwindSafe for KeyEvent<'a>
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