Android Guides | Samples

Android.Views.InputDevice Class

Describes the capabilities of a particular input device.

See Also: InputDevice

Syntax

[Android.Runtime.Register("android/view/InputDevice", DoNotGenerateAcw=true)]
public sealed class InputDevice : Object, IParcelable, IDisposable

Remarks

Describes the capabilities of a particular input device.

Each input device may support multiple classes of input. For example, a multi-function 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.

[Android Documentation]

Requirements

Namespace: Android.Views
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 9

The members of Android.Views.InputDevice are listed below.

See Also: Object

Public Fields

const
KeyboardTypeAlphabeticInputKeyboardType (2). The keyboard supports a complement of alphabetic keys.
const
KeyboardTypeNonAlphabeticInputKeyboardType (1). The keyboard is not fully alphabetic.
const
KeyboardTypeNoneInputKeyboardType (0). There is no keyboard.
const
MotionRangeOrientationMotionRange (8). Constant for retrieving the range of values for MotionEvent.AXIS_ORIENTATION.
const
MotionRangePressureMotionRange (2). Constant for retrieving the range of values for MotionEvent.AXIS_PRESSURE.
const
MotionRangeSizeMotionRange (3). Constant for retrieving the range of values for MotionEvent.AXIS_SIZE.
const
MotionRangeToolMajorMotionRange (6). Constant for retrieving the range of values for MotionEvent.AXIS_TOOL_MAJOR.
const
MotionRangeToolMinorMotionRange (7). Constant for retrieving the range of values for MotionEvent.AXIS_TOOL_MINOR.
const
MotionRangeTouchMajorMotionRange (4). Constant for retrieving the range of values for MotionEvent.AXIS_TOUCH_MAJOR.
const
MotionRangeTouchMinorMotionRange (5). Constant for retrieving the range of values for MotionEvent.AXIS_TOUCH_MINOR.
const
MotionRangeXMotionRange (0). Constant for retrieving the range of values for MotionEvent.AXIS_X.
const
MotionRangeYMotionRange (1). Constant for retrieving the range of values for MotionEvent.AXIS_Y.
const
SourceAnyInputSourceType (-256). A special input source constant that is used when filtering input devices to match devices that provide any type of input source.
const
SourceClassButtonInputSourceType (1). The input source has buttons or keys.
const
SourceClassJoystickInputSourceType (16). The input source is a joystick.
const
SourceClassMaskInputSourceType (255). A mask for input source classes.
const
SourceClassNoneInputSourceType (0). The input source has no class.
const
SourceClassPointerInputSourceType (2). The input source is a pointing device associated with a display.
const
SourceClassPositionInputSourceType (8). The input source is an absolute positioning device not associated with a display (unlike InputDevice.SourceClassPointer).
const
SourceClassTrackballInputSourceType (4). The input source is a trackball navigation device.
const
SourceDpadInputSourceType (513). The input source is a DPad.
const
SourceGamepadInputSourceType (1025). The input source is a game pad.
const
SourceHdmiInputSourceType (33554433). The input source is a device connected through HDMI-based bus.
const
SourceJoystickInputSourceType (16777232). The input source is a joystick.
const
SourceKeyboardInputSourceType (257). The input source is a keyboard.
const
SourceMouseInputSourceType (8194). The input source is a mouse pointing device.
const
SourceStylusInputSourceType (16386). The input source is a stylus pointing device.
const
SourceTouchNavigationInputSourceType (2097152). The input source is a touch device whose motions should be interpreted as navigation events.
const
SourceTouchpadInputSourceType (1048584). The input source is a touch pad or digitizer tablet that is not associated with a display (unlike InputDevice.SourceTouchscreen).
const
SourceTouchscreenInputSourceType (4098). The input source is a touch screen pointing device.
const
SourceTrackballInputSourceType (65540). The input source is a trackball.
const
SourceUnknownInputSourceType (0). The input source is unknown.

Public Properties

[read-only]
ControllerNumberInt32. The controller number for a given input device.
[read-only]
static
CreatorIParcelableCreator.
[read-only]
DescriptorString. Gets the input device descriptor, which is a stable identifier for an input device.
[read-only]
IdInt32. Gets the input device id.
[read-only]
IsVirtualBoolean. Returns true if the device is a virtual input device rather than a real one, such as the virtual keyboard (see KeyCharacterMap.VIRTUAL_KEYBOARD).
[read-only]
KeyboardTypeInputKeyboardType. Gets the keyboard type.
[read-only]
KeyCharacterMapKeyCharacterMap. Gets the key character map associated with this input device.
[read-only]
MotionRangesIList<InputDevice.MotionRange>. Gets the ranges for all axes supported by the device.
[read-only]
NameString. Gets the name of this input device.
[read-only]
ProductIdInt32. Gets the product id for the given device, if available.
[read-only]
SourcesInputSourceType. Gets the input sources supported by this input device as a combined bitfield.
[read-only]
VendorIdInt32. Gets the vendor id for the given device, if available.
[read-only]
VibratorVibrator. Gets the vibrator service associated with the device, if there is one.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

DescribeContents() : Int32
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
static
GetDevice(Int32) : InputDevice
Gets information about the input device with the specified id.
static
GetDeviceIds() : Int32[]
Gets the ids of all input devices in the system.
GetMotionRange(Axis) : InputDevice+MotionRange
Gets information about the range of values for a particular MotionEvent axis.
GetMotionRange(Axis, InputSourceType) : InputDevice+MotionRange
Gets information about the range of values for a particular MotionEvent axis used by a particular source on the device.
HasKeys(params Int32[]) : Boolean[]
SupportsSource(InputSourceType) : Boolean
Determines whether the input device supports the given source or sources.
WriteToParcel(Parcel, ParcelableWriteFlags)
Flatten this object in to a Parcel.