MotionEvent.Obtain MotionEvent.Obtain Method

Definition

Overloads

Obtain(MotionEvent) Obtain(MotionEvent)

Create a new MotionEvent, copying from an existing one.

Obtain(Int64, Int64, MotionEventActions, Single, Single, MetaKeyStates) Obtain(Int64, Int64, MotionEventActions, Single, Single, MetaKeyStates)

Create a new MotionEvent, filling in a subset of the basic motion values.

Obtain(Int64, Int64, Int32, Single, Single, MetaKeyStates) Obtain(Int64, Int64, Int32, Single, Single, MetaKeyStates)
Obtain(Int64, Int64, MotionEventActions, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge) Obtain(Int64, Int64, MotionEventActions, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)

Create a new MotionEvent, filling in all of the basic values that define the motion.

Obtain(Int64, Int64, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge) Obtain(Int64, Int64, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)
Obtain(Int64, Int64, MotionEventActions, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags) Obtain(Int64, Int64, MotionEventActions, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags)

Create a new MotionEvent, filling in all of the basic values that define the motion.

Obtain(Int64, Int64, MotionEventActions, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge) Obtain(Int64, Int64, MotionEventActions, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)

Create a new MotionEvent, filling in all of the basic values that define the motion.

Obtain(Int64, Int64, Int32, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, Int32, Int32) Obtain(Int64, Int64, Int32, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, Int32, Int32)
Obtain(Int64, Int64, Int32, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge) Obtain(Int64, Int64, Int32, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)
Obtain(Int64, Int64, MotionEventActions, Int32, MotionEvent+PointerProperties[], MotionEvent+PointerCoords[], MetaKeyStates, MotionEventButtonState, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags) Obtain(Int64, Int64, MotionEventActions, Int32, MotionEvent+PointerProperties[], MotionEvent+PointerCoords[], MetaKeyStates, MotionEventButtonState, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags)

Create a new MotionEvent, filling in all of the basic values that define the motion.

Obtain(MotionEvent) Obtain(MotionEvent)

Create a new MotionEvent, copying from an existing one.

[Android.Runtime.Register("obtain", "(Landroid/view/MotionEvent;)Landroid/view/MotionEvent;", "")]
public static Android.Views.MotionEvent Obtain (Android.Views.MotionEvent other);
static member Obtain : Android.Views.MotionEvent -> Android.Views.MotionEvent

Parameters

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, MotionEventActions, Single, Single, MetaKeyStates) Obtain(Int64, Int64, MotionEventActions, Single, Single, MetaKeyStates)

Create a new MotionEvent, filling in a subset of the basic motion values.

[Android.Runtime.Register("obtain", "(JJIFFI)Landroid/view/MotionEvent;", "")]
public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, Android.Views.MotionEventActions action, float x, float y, Android.Views.MetaKeyStates metaState);
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * single * single * Android.Views.MetaKeyStates -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64

The time (in ms) when the user originally pressed down to start a stream of position events. This must be obtained from UptimeMillis().

eventTime
Int64 Int64

The the time (in ms) when this specific event was generated. This must be obtained from UptimeMillis().

action
MotionEventActions MotionEventActions

F:Android.Support.V4.View.MotionEventCompat.ActionPointerDown

x
Single Single

The X coordinate of this event.

y
Single Single

The Y coordinate of this event.

metaState
MetaKeyStates MetaKeyStates

The state of any meta / modifier keys that were in effect when the event was generated.

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, Int32, Single, Single, MetaKeyStates) Obtain(Int64, Int64, Int32, Single, Single, MetaKeyStates)

public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, int action, float x, float y, Android.Views.MetaKeyStates metaState);
static member Obtain : int64 * int64 * int * single * single * Android.Views.MetaKeyStates -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64
eventTime
Int64 Int64
action
Int32 Int32

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, MotionEventActions, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge) Obtain(Int64, Int64, MotionEventActions, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)

Create a new MotionEvent, filling in all of the basic values that define the motion.

[Android.Runtime.Register("obtain", "(JJIFFFFIFFII)Landroid/view/MotionEvent;", "")]
public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, Android.Views.MotionEventActions action, float x, float y, float pressure, float size, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags);
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * single * single * single * single * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64

The time (in ms) when the user originally pressed down to start a stream of position events. This must be obtained from UptimeMillis().

eventTime
Int64 Int64

The the time (in ms) when this specific event was generated. This must be obtained from UptimeMillis().

action
MotionEventActions MotionEventActions

F:Android.Support.V4.View.MotionEventCompat.ActionPointerDown

x
Single Single

The X coordinate of this event.

y
Single Single

The Y coordinate of this event.

pressure
Single Single

The current pressure of this event. The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), however values higher than 1 may be generated depending on the calibration of the input device.

size
Single Single

A scaled value of the approximate size of the area being pressed when touched with the finger. The actual value in pixels corresponding to the finger touch is normalized with a device specific range of values and scaled to a value between 0 and 1.

metaState
MetaKeyStates MetaKeyStates

The state of any meta / modifier keys that were in effect when the event was generated.

xPrecision
Single Single

The precision of the X coordinate being reported.

yPrecision
Single Single

The precision of the Y coordinate being reported.

deviceId
Int32 Int32

The id for the device that this event came from. An id of zero indicates that the event didn't come from a physical device; other numbers are arbitrary and you shouldn't depend on the values.

edgeFlags
Edge Edge

A bitfield indicating which edges, if any, were touched by this MotionEvent.

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge) Obtain(Int64, Int64, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)

public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, int action, float x, float y, float pressure, float size, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags);
static member Obtain : int64 * int64 * int * single * single * single * single * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64
eventTime
Int64 Int64
action
Int32 Int32
pressure
Single Single
size
Single Single
xPrecision
Single Single
yPrecision
Single Single
deviceId
Int32 Int32
edgeFlags
Edge Edge

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, MotionEventActions, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags) Obtain(Int64, Int64, MotionEventActions, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags)

Warning

This API is now obsolete.

Create a new MotionEvent, filling in all of the basic values that define the motion.

[System.Obsolete("deprecated")]
[Android.Runtime.Register("obtain", "(JJII[I[Landroid/view/MotionEvent$PointerCoords;IFFIIII)Landroid/view/MotionEvent;", "", ApiSince=9)]
public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, Android.Views.MotionEventActions action, int pointerCount, int[] pointerIds, Android.Views.MotionEvent.PointerCoords[] pointerCoords, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags, Android.Views.InputSourceType source, Android.Views.MotionEventFlags flags);
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * int * int[] * Android.Views.MotionEvent.PointerCoords[] * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge * Android.Views.InputSourceType * Android.Views.MotionEventFlags -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64

The time (in ms) when the user originally pressed down to start a stream of position events. This must be obtained from UptimeMillis().

eventTime
Int64 Int64

The the time (in ms) when this specific event was generated. This must be obtained from UptimeMillis().

action
MotionEventActions MotionEventActions

F:Android.Support.V4.View.MotionEventCompat.ActionPointerDown

pointerCount
Int32 Int32

The number of pointers that will be in this event.

pointerIds
Int32[]

An array of pointerCount values providing an identifier for each pointer.

pointerCoords
MotionEvent.PointerCoords[]

An array of pointerCount values providing a MotionEvent PointerCoords coordinate object for each pointer.

metaState
MetaKeyStates MetaKeyStates

The state of any meta / modifier keys that were in effect when the event was generated.

xPrecision
Single Single

The precision of the X coordinate being reported.

yPrecision
Single Single

The precision of the Y coordinate being reported.

deviceId
Int32 Int32

The id for the device that this event came from. An id of zero indicates that the event didn't come from a physical device; other numbers are arbitrary and you shouldn't depend on the values.

edgeFlags
Edge Edge

A bitfield indicating which edges, if any, were touched by this MotionEvent.

source
InputSourceType InputSourceType

The source of this event.

flags
MotionEventFlags MotionEventFlags

The motion event flags.

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, MotionEventActions, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge) Obtain(Int64, Int64, MotionEventActions, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)

Warning

This API is now obsolete.

Create a new MotionEvent, filling in all of the basic values that define the motion.

[System.Obsolete("deprecated")]
[Android.Runtime.Register("obtain", "(JJIIFFFFIFFII)Landroid/view/MotionEvent;", "", ApiSince=5)]
public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, Android.Views.MotionEventActions action, int pointerCount, float x, float y, float pressure, float size, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags);
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * int * single * single * single * single * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64

The time (in ms) when the user originally pressed down to start a stream of position events. This must be obtained from UptimeMillis().

eventTime
Int64 Int64

The the time (in ms) when this specific event was generated. This must be obtained from UptimeMillis().

action
MotionEventActions MotionEventActions

F:Android.Support.V4.View.MotionEventCompat.ActionPointerDown

pointerCount
Int32 Int32

The number of pointers that are active in this event.

x
Single Single

The X coordinate of this event.

y
Single Single

The Y coordinate of this event.

pressure
Single Single

The current pressure of this event. The pressure generally ranges from 0 (no pressure at all) to 1 (normal pressure), however values higher than 1 may be generated depending on the calibration of the input device.

size
Single Single

A scaled value of the approximate size of the area being pressed when touched with the finger. The actual value in pixels corresponding to the finger touch is normalized with a device specific range of values and scaled to a value between 0 and 1.

metaState
MetaKeyStates MetaKeyStates

The state of any meta / modifier keys that were in effect when the event was generated.

xPrecision
Single Single

The precision of the X coordinate being reported.

yPrecision
Single Single

The precision of the Y coordinate being reported.

deviceId
Int32 Int32

The id for the device that this event came from. An id of zero indicates that the event didn't come from a physical device; other numbers are arbitrary and you shouldn't depend on the values.

edgeFlags
Edge Edge

A bitfield indicating which edges, if any, were touched by this MotionEvent.

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, Int32, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, Int32, Int32) Obtain(Int64, Int64, Int32, Int32, Int32[], MotionEvent+PointerCoords[], MetaKeyStates, Single, Single, Int32, Edge, Int32, Int32)

public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, int action, int pointers, int[] pointerIds, Android.Views.MotionEvent.PointerCoords[] pointerCoords, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags, int source, int flags);
static member Obtain : int64 * int64 * int * int * int[] * Android.Views.MotionEvent.PointerCoords[] * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge * int * int -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64
eventTime
Int64 Int64
action
Int32 Int32
pointers
Int32 Int32
pointerIds
Int32[]
pointerCoords
MotionEvent.PointerCoords[]
xPrecision
Single Single
yPrecision
Single Single
deviceId
Int32 Int32
edgeFlags
Edge Edge
source
Int32 Int32
flags
Int32 Int32

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, Int32, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge) Obtain(Int64, Int64, Int32, Int32, Single, Single, Single, Single, MetaKeyStates, Single, Single, Int32, Edge)

public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, int action, int pointers, float x, float y, float pressure, float size, Android.Views.MetaKeyStates metaState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags);
static member Obtain : int64 * int64 * int * int * single * single * single * single * Android.Views.MetaKeyStates * single * single * int * Android.Views.Edge -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64
eventTime
Int64 Int64
action
Int32 Int32
pointers
Int32 Int32
pressure
Single Single
size
Single Single
xPrecision
Single Single
yPrecision
Single Single
deviceId
Int32 Int32
edgeFlags
Edge Edge

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Obtain(Int64, Int64, MotionEventActions, Int32, MotionEvent+PointerProperties[], MotionEvent+PointerCoords[], MetaKeyStates, MotionEventButtonState, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags) Obtain(Int64, Int64, MotionEventActions, Int32, MotionEvent+PointerProperties[], MotionEvent+PointerCoords[], MetaKeyStates, MotionEventButtonState, Single, Single, Int32, Edge, InputSourceType, MotionEventFlags)

Create a new MotionEvent, filling in all of the basic values that define the motion.

[Android.Runtime.Register("obtain", "(JJII[Landroid/view/MotionEvent$PointerProperties;[Landroid/view/MotionEvent$PointerCoords;IIFFIIII)Landroid/view/MotionEvent;", "", ApiSince=14)]
public static Android.Views.MotionEvent Obtain (long downTime, long eventTime, Android.Views.MotionEventActions action, int pointerCount, Android.Views.MotionEvent.PointerProperties[] pointerProperties, Android.Views.MotionEvent.PointerCoords[] pointerCoords, Android.Views.MetaKeyStates metaState, Android.Views.MotionEventButtonState buttonState, float xPrecision, float yPrecision, int deviceId, Android.Views.Edge edgeFlags, Android.Views.InputSourceType source, Android.Views.MotionEventFlags flags);
static member Obtain : int64 * int64 * Android.Views.MotionEventActions * int * Android.Views.MotionEvent.PointerProperties[] * Android.Views.MotionEvent.PointerCoords[] * Android.Views.MetaKeyStates * Android.Views.MotionEventButtonState * single * single * int * Android.Views.Edge * Android.Views.InputSourceType * Android.Views.MotionEventFlags -> Android.Views.MotionEvent

Parameters

downTime
Int64 Int64

The time (in ms) when the user originally pressed down to start a stream of position events. This must be obtained from UptimeMillis().

eventTime
Int64 Int64

The the time (in ms) when this specific event was generated. This must be obtained from UptimeMillis().

action
MotionEventActions MotionEventActions

F:Android.Support.V4.View.MotionEventCompat.ActionPointerDown

pointerCount
Int32 Int32

The number of pointers that will be in this event.

pointerProperties
MotionEvent.PointerProperties[]

An array of pointerCount values providing a MotionEvent PointerProperties property object for each pointer, which must include the pointer identifier.

pointerCoords
MotionEvent.PointerCoords[]

An array of pointerCount values providing a MotionEvent PointerCoords coordinate object for each pointer.

metaState
MetaKeyStates MetaKeyStates

The state of any meta / modifier keys that were in effect when the event was generated.

buttonState
MotionEventButtonState MotionEventButtonState

The state of buttons that are pressed.

xPrecision
Single Single

The precision of the X coordinate being reported.

yPrecision
Single Single

The precision of the Y coordinate being reported.

deviceId
Int32 Int32

The id for the device that this event came from. An id of zero indicates that the event didn't come from a physical device; other numbers are arbitrary and you shouldn't depend on the values.

edgeFlags
Edge Edge

A bitfield indicating which edges, if any, were touched by this MotionEvent.

source
InputSourceType InputSourceType

The source of this event.

flags
MotionEventFlags MotionEventFlags

The motion event flags.

Returns

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to