diff options
| author | 2011-07-01 17:37:58 -0700 | |
|---|---|---|
| committer | 2011-07-25 20:04:18 -0700 | |
| commit | 49754db5a304d995c1cc108ff6f19e4ba4265572 (patch) | |
| tree | cb09f23e7dd81ea505f90962fd550e36afbbc422 /services/input/EventHub.cpp | |
| parent | 44e504e089b7483448c386741c5ee31d2c325400 (diff) | |
Handle stylus buttons and tool types.
Added TOOL_TYPE_ERASER.
Refactored the InputReader to share more code between the
various input mappers that handle button states and to
simplify the accumulator implementations by having each
one only handle a single type of input.
Removed the concept of direct/indirect tool types from the API.
If we add it back, it should be done in a manner that is orthogonal
to the tool type itself, perhaps as a flags field on the pointer.
The device source may well provide sufficient information anyhow.
Change-Id: I811c22d95e8304269b6ee4f6d11a6b04f3cfc1b2
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 ca2540bfad20..7ea3de2f4266 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); |