summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Satoshi Kataoka <satok@google.com> 2013-07-11 08:08:18 -0700
committer Android Git Automerger <android-git-automerger@android.com> 2013-07-11 08:08:18 -0700
commit713412fd54aba940ff67ab804292a2033681df89 (patch)
treea8308608365a9f98be2f166ceea02f6270901126
parent471fb03d461441cd0d9f4a79ed8126c923032218 (diff)
parent7e0fad1d442428b9a2ba5d88ce7f8a59869acb0e (diff)
am 7e0fad1d: am 8b95d259: am b7925f22: Merge "Revert "Stop marking gamepads as keyboards"" into jb-mr2-dev
* commit '7e0fad1d442428b9a2ba5d88ce7f8a59869acb0e': Revert "Stop marking gamepads as keyboards"
-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 65749b353404..fab091f9617d 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)) {