java.lang.Object | |
↳ | android.view.InputDevice |
Describes the capabilities of a particular input device.
Each input device may support multiple classes of input. For example, a multifunction keyboard may compose the capabilities of a standard keyboard together with a track pad mouse or other pointing device.
Some input devices present multiple distinguishable sources of input. Applications can query the framework about the characteristics of each distinct source.
As a further wrinkle, different kinds of input sources uses different coordinate systems to describe motion events. Refer to the comments on the input source constants for the appropriate interpretation.
Nested Classes | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
InputDevice.MotionRange | Provides information about the range of values for a particular MotionEvent axis. |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | KEYBOARD_TYPE_ALPHABETIC | The keyboard supports a complement of alphabetic keys. | |||||||||
int | KEYBOARD_TYPE_NONE | There is no keyboard. | |||||||||
int | KEYBOARD_TYPE_NON_ALPHABETIC | The keyboard is not fully alphabetic. | |||||||||
int | MOTION_RANGE_ORIENTATION |
This constant is deprecated.
Use AXIS_ORIENTATION instead.
|
|||||||||
int | MOTION_RANGE_PRESSURE |
This constant is deprecated.
Use AXIS_PRESSURE instead.
|
|||||||||
int | MOTION_RANGE_SIZE |
This constant is deprecated.
Use AXIS_SIZE instead.
|
|||||||||
int | MOTION_RANGE_TOOL_MAJOR |
This constant is deprecated.
Use AXIS_TOOL_MAJOR instead.
|
|||||||||
int | MOTION_RANGE_TOOL_MINOR |
This constant is deprecated.
Use AXIS_TOOL_MINOR instead.
|
|||||||||
int | MOTION_RANGE_TOUCH_MAJOR |
This constant is deprecated.
Use AXIS_TOUCH_MAJOR instead.
|
|||||||||
int | MOTION_RANGE_TOUCH_MINOR |
This constant is deprecated.
Use AXIS_TOUCH_MINOR instead.
|
|||||||||
int | MOTION_RANGE_X |
This constant is deprecated.
Use AXIS_X instead.
|
|||||||||
int | MOTION_RANGE_Y |
This constant is deprecated.
Use AXIS_Y instead.
|
|||||||||
int | SOURCE_ANY | A special input source constant that is used when filtering input devices to match devices that provide any type of input source. | |||||||||
int | SOURCE_CLASS_BUTTON | The input source has buttons or keys. | |||||||||
int | SOURCE_CLASS_JOYSTICK | The input source is a joystick. | |||||||||
int | SOURCE_CLASS_MASK | A mask for input source classes. | |||||||||
int | SOURCE_CLASS_POINTER | The input source is a pointing device associated with a display. | |||||||||
int | SOURCE_CLASS_POSITION | The input source is an absolute positioning device not associated with a display
(unlike SOURCE_CLASS_POINTER ). |
|||||||||
int | SOURCE_CLASS_TRACKBALL | The input source is a trackball navigation device. | |||||||||
int | SOURCE_DPAD | The input source is a DPad. | |||||||||
int | SOURCE_GAMEPAD | The input source is a game pad. | |||||||||
int | SOURCE_JOYSTICK | The input source is a joystick. | |||||||||
int | SOURCE_KEYBOARD | The input source is a keyboard. | |||||||||
int | SOURCE_MOUSE | The input source is a mouse pointing device. | |||||||||
int | SOURCE_STYLUS | The input source is a stylus pointing device. | |||||||||
int | SOURCE_TOUCHPAD | The input source is a touch pad or digitizer tablet that is not
associated with a display (unlike SOURCE_TOUCHSCREEN ). |
|||||||||
int | SOURCE_TOUCHSCREEN | The input source is a touch screen pointing device. | |||||||||
int | SOURCE_TRACKBALL | The input source is a trackball. | |||||||||
int | SOURCE_UNKNOWN | The input source is unknown. |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
android.os.Parcelable
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CREATOR |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
| |||||||||||
Gets information about the input device with the specified id.
| |||||||||||
Gets the ids of all input devices in the system.
| |||||||||||
Gets the input device id.
| |||||||||||
Gets the key character map associated with this input device.
| |||||||||||
Gets the keyboard type.
| |||||||||||
Gets information about the range of values for a particular
MotionEvent axis
used by a particular source on the device. | |||||||||||
Gets information about the range of values for a particular
MotionEvent axis. | |||||||||||
Gets the ranges for all axes supported by the device.
| |||||||||||
Gets the name of this input device.
| |||||||||||
Gets the input sources supported by this input device as a combined bitfield.
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
| |||||||||||
Flatten this object in to a Parcel.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
android.os.Parcelable
|
The keyboard supports a complement of alphabetic keys.
There is no keyboard.
The keyboard is not fully alphabetic. It may be a numeric keypad or an assortment of buttons that are not mapped as alphabetic keys suitable for text input.
This constant is deprecated.
Use AXIS_ORIENTATION
instead.
Constant for retrieving the range of values for AXIS_ORIENTATION
.
This constant is deprecated.
Use AXIS_PRESSURE
instead.
Constant for retrieving the range of values for AXIS_PRESSURE
.
This constant is deprecated.
Use AXIS_TOOL_MAJOR
instead.
Constant for retrieving the range of values for AXIS_TOOL_MAJOR
.
This constant is deprecated.
Use AXIS_TOOL_MINOR
instead.
Constant for retrieving the range of values for AXIS_TOOL_MINOR
.
This constant is deprecated.
Use AXIS_TOUCH_MAJOR
instead.
Constant for retrieving the range of values for AXIS_TOUCH_MAJOR
.
This constant is deprecated.
Use AXIS_TOUCH_MINOR
instead.
Constant for retrieving the range of values for AXIS_TOUCH_MINOR
.
A special input source constant that is used when filtering input devices to match devices that provide any type of input source.
The input source has buttons or keys.
Examples: SOURCE_KEYBOARD
, SOURCE_DPAD
.
A KeyEvent
should be interpreted as a button or key press.
Use getKeyCharacterMap()
to query the device's button and key mappings.
The input source is a joystick.
A MotionEvent
should be interpreted as absolute joystick movements.
Use getMotionRange(int)
to query the range of positions.
A mask for input source classes. Each distinct input source constant has one or more input source class bits set to specify the desired interpretation for its input events.
The input source is a pointing device associated with a display.
Examples: SOURCE_TOUCHSCREEN
, SOURCE_MOUSE
.
A MotionEvent
should be interpreted as absolute coordinates in
display units according to the View
hierarchy. Pointer down/up indicated when
the finger touches the display or when the selection button is pressed/released.
Use getMotionRange(int)
to query the range of the pointing device. Some devices permit
touches outside the display area so the effective range may be somewhat smaller or larger
than the actual display size.
The input source is an absolute positioning device not associated with a display
(unlike SOURCE_CLASS_POINTER
).
A MotionEvent
should be interpreted as absolute coordinates in
device-specific surface units.
Use getMotionRange(int)
to query the range of positions.
The input source is a trackball navigation device.
Examples: SOURCE_TRACKBALL
.
A MotionEvent
should be interpreted as relative movements in device-specific
units used for navigation purposes. Pointer down/up indicates when the selection button
is pressed/released.
Use getMotionRange(int)
to query the range of motion.
The input source is a game pad.
(It may also be a SOURCE_JOYSTICK
).
The input source is a joystick.
(It may also be a SOURCE_GAMEPAD
).
The input source is a mouse pointing device. This code is also used for other mouse-like pointing devices such as trackpads and trackpoints.
The input source is a stylus pointing device.
The input source is a touch pad or digitizer tablet that is not
associated with a display (unlike SOURCE_TOUCHSCREEN
).
The input source is a touch screen pointing device.
The input source is unknown.
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
Gets information about the input device with the specified id.
id | The device id. |
---|
Gets the ids of all input devices in the system.
Gets the key character map associated with this input device.
Gets information about the range of values for a particular MotionEvent
axis
used by a particular source on the device.
If the device supports multiple sources, the same axis may have different meanings
for each source.
axis | The axis constant. |
---|---|
source | The source for which to return information. |
Gets information about the range of values for a particular MotionEvent
axis.
If the device supports multiple sources, the same axis may have different meanings
for each source. Returns information about the first axis found for any source.
To obtain information about the axis for a specific source, use
getMotionRange(int, int)
.
axis | The axis constant. |
---|
Gets the ranges for all axes supported by the device.
Gets the name of this input device.
Gets the input sources supported by this input device as a combined bitfield.
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful
toString
method
if you intend implementing your own toString
method.
Flatten this object in to a Parcel.
out | The Parcel in which the object should be written. |
---|---|
flags | Additional flags about how the object should be written.
May be 0 or PARCELABLE_WRITE_RETURN_VALUE .
|