Enum ndk::event::InputEvent
source · [−]pub enum InputEvent {
MotionEvent(MotionEvent),
KeyEvent(KeyEvent),
}
Expand description
A native AInputEvent *
Variants
MotionEvent(MotionEvent)
KeyEvent(KeyEvent)
Implementations
sourceimpl 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
Safety
By calling this function, you assert that the pointer is a valid pointer to a
native ffi::AInputEvent
.
sourcepub fn ptr(&self) -> NonNull<AInputEvent>
pub fn ptr(&self) -> NonNull<AInputEvent>
Returns a pointer to the native ffi::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 RefUnwindSafe for InputEvent
impl !Send for InputEvent
impl !Sync for InputEvent
impl Unpin for InputEvent
impl UnwindSafe for InputEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more