diff options
| author | Michael Wright <michaelwr@google.com> | 2013-08-19 15:55:38 -0700 |
|---|---|---|
| committer | Michael Wright <michaelwr@google.com> | 2013-08-19 17:06:03 -0700 |
| commit | b7b2d4b490f5dd672e0b00ced579dc052e3637e9 (patch) | |
| tree | 35a71da019d22046f57633a6513cf93ad51f9f59 /core/java/android/view/InputDevice.java | |
| parent | b6c38e9de1a2824ce599d7074fa4a226926177c1 (diff) | |
Expose API to query devices for supported keys
Change-Id: I29f230e19c6f851b4b72b2fc8dd41f5abcba4631
Diffstat (limited to 'core/java/android/view/InputDevice.java')
| -rw-r--r-- | core/java/android/view/InputDevice.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index f43e4ab3c133..afc7b3e789a6 100644 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java @@ -574,6 +574,16 @@ public final class InputDevice implements Parcelable { } /** + * Gets whether the device is capable of producing the list of keycodes. + * @param keys The list of android keycodes to check for. + * @return An array of booleans where each member specifies whether the device is capable of + * generating the keycode given by the corresponding value at the same index in the keys array. + */ + public boolean[] hasKeys(int... keys) { + return InputManager.getInstance().deviceHasKeys(mId, keys); + } + + /** * Gets information about the range of values for a particular {@link 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. |
