diff options
author | 2013-07-09 17:20:37 +0000 | |
---|---|---|
committer | 2013-07-09 17:20:39 +0000 | |
commit | b7925f2219480d4ddbb1c655b9b386ed031815a3 (patch) | |
tree | 5adf3795de27739aeab1f6c1ca6c4fc8c4f9014f | |
parent | ea4193efaafb280e9e969cae72a4f43b913ae8b0 (diff) | |
parent | 02a44f7d4715bf876aad6b420a0c7c1782965aa0 (diff) |
Merge "Revert "Stop marking gamepads as keyboards"" into jb-mr2-dev
-rw-r--r-- | services/input/EventHub.cpp | 13 |
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)) { |