#[repr(transparent)]
pub struct MotionEvent<'a> { /* private fields */ }
Expand description

A motion event

For general discussion of motion events in Android, see the relevant javadoc.

Implementations

Get the source of the event.

Get the class of the event source.

Get the device id associated with the event.

Returns the motion action associated with the event.

See the MotionEvent docs

Returns the pointer index of an Up or Down event.

Pointer indices can change per motion event. For an identifier that stays the same, see Pointer::pointer_id().

This only has a meaning when the action is one of Up, Down, PointerUp, or PointerDown.

Returns the number of pointers in this event

See the MotionEvent docs

An iterator over the pointers in this motion event

The pointer at a given pointer index. Panics if the pointer index is out of bounds.

If you need to loop over all the pointers, prefer the pointers() method.

Returns the state of any modifier keys that were pressed during the event.

See the NDK docs

Returns the button state during this event, as a bitfield.

See the NDK docs

Returns the time of the start of this gesture, in the java.lang.System.nanoTime() time base

See the NDK docs

Returns a bitfield indicating which edges were touched by this event.

See the NDK docs

Returns the time of this event, in the java.lang.System.nanoTime() time base

See the NDK docs

The flags associated with a motion event.

See the NDK docs

Returns the precision of the x value of the coordinates

See the NDK docs

Returns the precision of the y value of the coordinates

See the NDK docs

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.