pub enum InputEvent {
MotionEvent(MotionEvent),
KeyEvent(KeyEvent),
}
Expand description
A const AInputEvent *
See the NDK docs
Variants§
MotionEvent(MotionEvent)
KeyEvent(KeyEvent)
Implementations§
Source§impl InputEvent
impl InputEvent
Sourcepub unsafe fn from_ptr(ptr: NonNull<AInputEvent>) -> Self
pub unsafe fn from_ptr(ptr: NonNull<AInputEvent>) -> Self
Initialize an InputEvent
from a pointer
By calling this function, you assert that the pointer is a valid pointer to a
native AInputEvent
.
Sourcepub fn ptr(&self) -> NonNull<AInputEvent>
pub fn ptr(&self) -> NonNull<AInputEvent>
Returns a pointer to the native AInputEvent
.
Sourcepub fn source(&self) -> Source
pub fn source(&self) -> Source
Get the source of the event.
See the NDK docs
Sourcepub fn device_id(&self) -> i32
pub fn device_id(&self) -> i32
Get the device id associated with the event.
See the NDK docs
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InputEvent
impl RefUnwindSafe for InputEvent
impl !Send for InputEvent
impl !Sync for InputEvent
impl Unpin for InputEvent
impl UnwindSafe for InputEvent
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more