summaryrefslogtreecommitdiffstats
path: root/services/input
diff options
context:
space:
mode:
authorSatoshi Kataoka <satok@google.com>2013-07-09 10:25:02 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-07-09 10:25:02 -0700
commit7e0fad1d442428b9a2ba5d88ce7f8a59869acb0e (patch)
treec54e8af22ec80e315b6eb555c1070bba4ceefa5e /services/input
parentfc13329b8430a62c02f7109e1b7cf0abcaa896ee (diff)
parent8b95d259b9f66342ba5ae6e8f4ea262dcb1de05b (diff)
downloadframeworks_base-7e0fad1d442428b9a2ba5d88ce7f8a59869acb0e.zip
frameworks_base-7e0fad1d442428b9a2ba5d88ce7f8a59869acb0e.tar.gz
frameworks_base-7e0fad1d442428b9a2ba5d88ce7f8a59869acb0e.tar.bz2
am 8b95d259: am b7925f22: Merge "Revert "Stop marking gamepads as keyboards"" into jb-mr2-dev
* commit '8b95d259b9f66342ba5ae6e8f4ea262dcb1de05b': Revert "Stop marking gamepads as keyboards"
Diffstat (limited to 'services/input')
-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 376de96..f4e1cec 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)) {