Freigeben über


InputDevice Class

Definition

Describes the capabilities of a particular input device.

[Android.Runtime.Register("android/view/InputDevice", DoNotGenerateAcw=true)]
public sealed class InputDevice : Java.Lang.Object, Android.OS.IParcelable, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/view/InputDevice", DoNotGenerateAcw=true)>]
type InputDevice = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
InputDevice
Attributes
Implements

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.

Java documentation for android.view.InputDevice.

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.

Fields

KeyboardTypeAlphabetic
Obsolete.

The keyboard supports a complement of alphabetic keys.

KeyboardTypeNonAlphabetic
Obsolete.

The keyboard is not fully alphabetic.

KeyboardTypeNone
Obsolete.

There is no keyboard.

MotionRangeOrientation
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_ORIENTATION.

MotionRangePressure
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_PRESSURE.

MotionRangeSize
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_SIZE.

MotionRangeToolMajor
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_TOOL_MAJOR.

MotionRangeToolMinor
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_TOOL_MINOR.

MotionRangeTouchMajor
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_TOUCH_MAJOR.

MotionRangeTouchMinor
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_TOUCH_MINOR.

MotionRangeX
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_X.

MotionRangeY
Obsolete.

Constant for retrieving the range of values for MotionEvent#AXIS_Y.

SourceAny
Obsolete.

A special input source constant that is used when filtering input devices to match devices that provide any type of input source.

SourceBluetoothStylus
Obsolete.

The input device is a Bluetooth stylus.

SourceClassButton
Obsolete.

The input source has buttons or keys.

SourceClassJoystick
Obsolete.

The input source is a joystick.

SourceClassMask
Obsolete.

A mask for input source classes.

SourceClassNone
Obsolete.

The input source has no class.

SourceClassPointer
Obsolete.

The input source is a pointing device associated with a display.

SourceClassPosition
Obsolete.

The input source is an absolute positioning device not associated with a display (unlike #SOURCE_CLASS_POINTER).

SourceClassTrackball
Obsolete.

The input source is a trackball navigation device.

SourceDpad
Obsolete.

The input source is a DPad.

SourceGamepad
Obsolete.

The input source is a game pad.

SourceHdmi
Obsolete.

The input source is a device connected through HDMI-based bus.

SourceJoystick
Obsolete.

The input source is a joystick.

SourceKeyboard
Obsolete.

The input source is a keyboard.

SourceMouse
Obsolete.

The input source is a mouse pointing device.

SourceMouseRelative
Obsolete.

The input source is a mouse device whose relative motions should be interpreted as navigation events.

SourceRotaryEncoder
Obsolete.

The input source is a rotating encoder device whose motions should be interpreted as akin to those of a scroll wheel.

SourceSensor
Obsolete.

The input source is a sensor associated with the input device.

SourceStylus
Obsolete.

The input source is a stylus pointing device.

SourceTouchNavigation
Obsolete.

The input source is a touch device whose motions should be interpreted as navigation events.

SourceTouchpad
Obsolete.

The input source is a touchpad (also known as a trackpad).

SourceTouchscreen
Obsolete.

The input source is a touch screen pointing device.

SourceTrackball
Obsolete.

The input source is a trackball.

SourceUnknown
Obsolete.

The input source is unknown.

Properties

BatteryState

Gets the battery state object associated with the device, if there is one.

Class

Returns the runtime class of this Object.

(Inherited from Object)
ControllerNumber

The controller number for a given input device.

Creator
Descriptor

Gets the input device descriptor, which is a stable identifier for an input device.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasMicrophone

Reports whether the device has a built-in microphone.

Id

Gets the input device id.

IsEnabled

Returns true if input device is enabled.

IsExternal

Returns true if the device is external (connected to USB or Bluetooth or some other peripheral bus), otherwise it is built-in.

IsVirtual

Returns true if the device is a virtual input device rather than a real one, such as the virtual keyboard (see KeyCharacterMap#VIRTUAL_KEYBOARD).

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
KeyboardType

Gets the keyboard type.

KeyCharacterMap

Gets the key character map associated with this input device.

LightsManager

Gets the lights manager associated with the device, if there is one.

MotionRanges

Gets the ranges for all axes supported by the device.

Name

Gets the name of this input device.

PeerReference (Inherited from Object)
ProductId

Gets the product id for the given device, if available.

SensorManager

Gets the sensor manager service associated with the input device.

Sources

Gets the input sources supported by this input device as a combined bitfield.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
VendorId

Gets the vendor id for the given device, if available.

Vibrator

Gets the vibrator service associated with the device, if there is one.

VibratorManager

Gets the vibrator manager associated with the device.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
DescribeContents()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetDevice(Int32)

Gets information about the input device with the specified id.

GetDeviceIds()

Gets the ids of all input devices in the system.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetKeyCodeForKeyLocation(Int32)

Gets the android.view.KeyEvent key code produced by the given location on a reference QWERTY keyboard layout.

GetMotionRange(Axis, InputSourceType)

Gets information about the range of values for a particular MotionEvent axis.

GetMotionRange(Axis)

Gets information about the range of values for a particular MotionEvent axis.

GetMotionRange(Int32)
HasKeys(Int32[])

Gets whether the device is capable of producing the list of keycodes.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SupportsSource(InputSourceType)

Determines whether the input device supports the given source or sources.

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this object in to a Parcel.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to