Struct android_activity::input::KeyEvent
source · #[repr(transparent)]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
Trait Implementations§
Auto Trait Implementations§
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