diff options
author | DanielK <daniel.kenzelmann@googlemail.com> | 2012-03-20 14:28:43 +0800 |
---|---|---|
committer | Chih-Wei Huang <cwhuang@linux.org.tw> | 2016-05-06 01:57:08 +0800 |
commit | e9c7348ec8cb6f9e9d44be3b905f30a0615e0cb8 (patch) | |
tree | 556199c4467cc15660e3b533f5847661562f57d7 | |
parent | a59b827869a2ea04022dd225007f29af8d61837a (diff) | |
download | frameworks_native-e9c7348ec8cb6f9e9d44be3b905f30a0615e0cb8.zip frameworks_native-e9c7348ec8cb6f9e9d44be3b905f30a0615e0cb8.tar.gz frameworks_native-e9c7348ec8cb6f9e9d44be3b905f30a0615e0cb8.tar.bz2 |
Support old single-touch touchscreens with BTN_LEFT
-rw-r--r-- | services/inputflinger/EventHub.cpp | 2 | ||||
-rw-r--r-- | services/inputflinger/InputReader.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/services/inputflinger/EventHub.cpp b/services/inputflinger/EventHub.cpp index 5859606..fc8989f 100644 --- a/services/inputflinger/EventHub.cpp +++ b/services/inputflinger/EventHub.cpp @@ -1202,7 +1202,7 @@ status_t EventHub::openDeviceLocked(const char *devicePath) { device->classes |= INPUT_DEVICE_CLASS_TOUCH | INPUT_DEVICE_CLASS_TOUCH_MT; } // Is this an old style single-touch driver? - } else if (test_bit(BTN_TOUCH, device->keyBitmask) + } else if ((test_bit(BTN_TOUCH, device->keyBitmask) || test_bit(BTN_LEFT, device->keyBitmask)) && test_bit(ABS_X, device->absBitmask) && test_bit(ABS_Y, device->absBitmask)) { device->classes |= INPUT_DEVICE_CLASS_TOUCH; diff --git a/services/inputflinger/InputReader.cpp b/services/inputflinger/InputReader.cpp index b2cbfe8..5c41915 100644 --- a/services/inputflinger/InputReader.cpp +++ b/services/inputflinger/InputReader.cpp @@ -1345,7 +1345,7 @@ TouchButtonAccumulator::TouchButtonAccumulator() : } void TouchButtonAccumulator::configure(InputDevice* device) { - mHaveBtnTouch = device->hasKey(BTN_TOUCH); + mHaveBtnTouch = device->hasKey(BTN_TOUCH) || device->hasKey(BTN_LEFT); mHaveStylus = device->hasKey(BTN_TOOL_PEN) || device->hasKey(BTN_TOOL_RUBBER) || device->hasKey(BTN_TOOL_BRUSH) @@ -1354,7 +1354,7 @@ void TouchButtonAccumulator::configure(InputDevice* device) { } void TouchButtonAccumulator::reset(InputDevice* device) { - mBtnTouch = device->isKeyPressed(BTN_TOUCH); + mBtnTouch = device->isKeyPressed(BTN_TOUCH) || device->isKeyPressed(BTN_LEFT); mBtnStylus = device->isKeyPressed(BTN_STYLUS); // BTN_0 is what gets mapped for the HID usage Digitizers.SecondaryBarrelSwitch mBtnStylus2 = @@ -1393,6 +1393,7 @@ void TouchButtonAccumulator::process(const RawEvent* rawEvent) { if (rawEvent->type == EV_KEY) { switch (rawEvent->code) { case BTN_TOUCH: + case BTN_LEFT: mBtnTouch = rawEvent->value; break; case BTN_STYLUS: |