summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2013-07-05 04:08:36 +0000
committerThe Android Automerger <android-build@android.com>2013-07-09 16:32:15 -0700
commit2e55547acca4d5399cd1ff843ae6ec99c79d6782 (patch)
treea115125b6391e4cb45e090b170d7fb14c7fb0626
parent1f902a55f87990b0295459f665227fda1b04178f (diff)
downloadbase-2e55547acca4d5399cd1ff843ae6ec99c79d6782.tar.gz
Revert "Stop marking gamepads as keyboards"android-4.3_r1
This reverts commit 74c8fb601ef75d8e12df5221489c41c125e3b846. Change-Id: If8ca4d09b4d52f11d48dabebf2dff2984760cdc0 bug: 8896129
-rw-r--r--services/input/EventHub.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp
index 376de960ab17..f4e1cec49e04 100644
--- a/services/input/EventHub.cpp
+++ b/services/input/EventHub.cpp
@@ -1188,6 +1188,11 @@ status_t EventHub::openDeviceLocked(const char *devicePath) {
mBuiltInKeyboardId = device->id;
}
+ // 'Q' key support = cheap test of whether this is an alpha-capable kbd
+ if (hasKeycodeLocked(device, AKEYCODE_Q)) {
+ device->classes |= INPUT_DEVICE_CLASS_ALPHAKEY;
+ }
+
// See if this device has a DPAD.
if (hasKeycodeLocked(device, AKEYCODE_DPAD_UP) &&
hasKeycodeLocked(device, AKEYCODE_DPAD_DOWN) &&
@@ -1205,14 +1210,6 @@ status_t EventHub::openDeviceLocked(const char *devicePath) {
}
}
- // 'Q' key support = cheap test of whether this is an alpha-capable kbd. Many gamepads will
- // report a broader set of HID usages than they need, however, so we only want to mark this
- // device as a keyboard if it is not a gamepad.
- if (hasKeycodeLocked(device, AKEYCODE_Q) &&
- !(device->classes & INPUT_DEVICE_CLASS_GAMEPAD)) {
- device->classes |= INPUT_DEVICE_CLASS_ALPHAKEY;
- }
-
// Disable kernel key repeat since we handle it ourselves
unsigned int repeatRate[] = {0,0};
if (ioctl(fd, EVIOCSREP, repeatRate)) {