diff options
| author | Jeff Brown <jeffbrown@google.com> | 2010-07-23 21:28:06 -0700 |
|---|---|---|
| committer | Jeff Brown <jeffbrown@google.com> | 2010-07-28 14:16:15 -0700 |
| commit | 6d0fec2de3601821f4f44eeb7d7deedebb2b7117 (patch) | |
| tree | 9fdea32c5691a6d0bcb3085df47f42a8e6ecd565 /core/java/android/view/InputDevice.java | |
| parent | b350bec514eb9fee473e4ef62680c53e992dc49b (diff) | |
Refactor input reader to support new device types more easily.
Refactored the input reader so that each raw input protocol is handled
by a separate subclass of the new InputMapper type. This way, behaviors
pertaining to keyboard, trackballs, touchscreens, switches and other
devices are clearly distinguished for improved maintainability.
Added partial support for describing capabilities of input devices
(incomplete and untested for now, will be fleshed out in later commits).
Simplified EventHub interface somewhat since InputReader is taking over
more of the work.
Cleaned up some of the interactions between InputManager and
WindowManagerService related to reading input state.
Fixed swiping finger from screen edge into display area.
Added logging of device information to 'dumpsys window'.
Change-Id: I17faffc33e3aec3a0f33f0b37e81a70609378612
Diffstat (limited to 'core/java/android/view/InputDevice.java')
| -rwxr-xr-x | core/java/android/view/InputDevice.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/core/java/android/view/InputDevice.java b/core/java/android/view/InputDevice.java index 21c297675052..d5b2121ea3dd 100755 --- a/core/java/android/view/InputDevice.java +++ b/core/java/android/view/InputDevice.java @@ -30,11 +30,13 @@ package android.view; * 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. + * </p> */ public final class InputDevice { private int mId; private String mName; private int mSources; + private int mKeyboardType; /** * A mask for input source classes. @@ -173,6 +175,12 @@ public final class InputDevice { * @see #SOURCE_CLASS_JOYSTICK */ public static final int SOURCE_JOYSTICK_RIGHT = 0x02000000 | SOURCE_CLASS_JOYSTICK; + + /** + * A special input source constant that is used when filtering input devices + * to match devices that provide any type of input source. + */ + public static final int SOURCE_ANY = 0xffffff00; /** * Constant for retrieving the range of values for {@link MotionEvent.PointerCoords#x}. @@ -237,6 +245,22 @@ public final class InputDevice { * @see #getMotionRange */ public static final int MOTION_RANGE_ORIENTATION = 8; + + /** + * There is no keyboard. + */ + public static final int KEYBOARD_TYPE_NONE = 0; + + /** + * 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. + */ + public static final int KEYBOARD_TYPE_NON_ALPHABETIC = 1; + + /** + * The keyboard supports a complement of alphabetic keys. + */ + public static final int KEYBOARD_TYPE_ALPHABETIC = 2; /** * Gets information about the input device with the specified id. @@ -265,6 +289,14 @@ public final class InputDevice { } /** + * Gets the keyboard type. + * @return The keyboard type. + */ + public int getKeyboardType() { + return mKeyboardType; + } + + /** * Gets the key character map associated with this input device. * @return The key character map. */ |
