diff options
Diffstat (limited to 'services/input/EventHub.cpp')
-rw-r--r-- | services/input/EventHub.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/services/input/EventHub.cpp b/services/input/EventHub.cpp index ca2540b..7ea3de2 100644 --- a/services/input/EventHub.cpp +++ b/services/input/EventHub.cpp @@ -460,6 +460,17 @@ void EventHub::setExcludedDevices(const Vector<String8>& devices) { mExcludedDevices = devices; } +bool EventHub::hasScanCode(int32_t deviceId, int32_t scanCode) const { + AutoMutex _l(mLock); + Device* device = getDeviceLocked(deviceId); + if (device && scanCode >= 0 && scanCode <= KEY_MAX) { + if (test_bit(scanCode, device->keyBitmask)) { + return true; + } + } + return false; +} + bool EventHub::hasLed(int32_t deviceId, int32_t led) const { AutoMutex _l(mLock); Device* device = getDeviceLocked(deviceId); |