abstract class InputEvent : Parcelable
Known Direct Subclasses
KeyEvent |
Object used to report key and button events.
|
MotionEvent |
Object used to report movement (mouse, pen, finger, trackball) events.
|
|
Common base class for input events.
Summary
Inherited constants |
From class Parcelable
Int |
CONTENTS_FILE_DESCRIPTOR
Descriptor bit used with describeContents() : indicates that the Parcelable object's flattened representation includes a file descriptor.
|
Int |
PARCELABLE_WRITE_RETURN_VALUE
Flag for use with writeToParcel : the object being written is a return value, that is the result of a function such as "Parcelable someFunction() ", "void someFunction(out Parcelable) ", or "void someFunction(inout Parcelable) ". Some implementations may want to release resources at this point.
|
|
Public methods |
open Int |
|
InputDevice! |
Gets the device that this event came from.
|
abstract Int |
Gets the id for the device that this event came from.
|
abstract Long |
Retrieve the time this event occurred, in the android.os.SystemClock#uptimeMillis time base.
|
abstract Int |
Gets the source of the event.
|
open Boolean |
Determines whether the event is from the given source.
|
Public methods
describeContents
open fun describeContents(): Int
getDevice
fun getDevice(): InputDevice!
Gets the device that this event came from.
getDeviceId
abstract fun getDeviceId(): Int
Gets 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 and maps to the default keymap. The other numbers are arbitrary and you shouldn't depend on the values.
Return |
Int |
The device id. |
getSource
abstract fun getSource(): Int
Gets the source of the event.
isFromSource
open fun isFromSource(source: Int): Boolean
Determines whether the event is from the given source.
Return |
Boolean |
Whether the event is from the given source. |
Properties
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[]]