mirror of
https://github.com/openharmony/distributedhardware_distributed_input.git
synced 2026-07-20 21:41:02 -04:00
Description:support touchpad on WGR
Match-id-e2fc5dc8f9e7e6f1e624e88309ead2ccd3721990
This commit is contained in:
@@ -514,12 +514,6 @@ int32_t InputHub::MakeDevice(int fd, std::unique_ptr<Device> device)
|
||||
ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(device->absBitmask)), device->absBitmask);
|
||||
ioctl(fd, EVIOCGBIT(EV_REL, sizeof(device->relBitmask)), device->relBitmask);
|
||||
|
||||
// See if this is a keyboard.
|
||||
bool haveKeyboardKeys = ContainsNonZeroByte(device->keyBitmask, 0, SizeofBitArray(BTN_MISC));
|
||||
if (haveKeyboardKeys) {
|
||||
device->classes |= INPUT_DEVICE_CLASS_KEYBOARD;
|
||||
}
|
||||
|
||||
// See if this is a cursor device such as a trackball or mouse.
|
||||
if (TestBit(BTN_MOUSE, device->keyBitmask)
|
||||
&& TestBit(REL_X, device->relBitmask)
|
||||
@@ -527,6 +521,16 @@ int32_t InputHub::MakeDevice(int fd, std::unique_ptr<Device> device)
|
||||
device->classes |= INPUT_DEVICE_CLASS_CURSOR;
|
||||
}
|
||||
|
||||
// for Linux version 4.14.116, touchpad recognized as mouse and keyboard at same time,
|
||||
// need to avoid device->classes to be 0x09, which mmi can't handler.
|
||||
// See if this is a keyboard.
|
||||
if (device->classes == 0) {
|
||||
bool haveKeyboardKeys = ContainsNonZeroByte(device->keyBitmask, 0, SizeofBitArray(BTN_MISC));
|
||||
if (haveKeyboardKeys) {
|
||||
device->classes |= INPUT_DEVICE_CLASS_KEYBOARD;
|
||||
}
|
||||
}
|
||||
|
||||
// If the device isn't recognized as something we handle, don't monitor it.
|
||||
if (device->classes == 0) {
|
||||
DHLOGI("Dropping device: name='%s'", device->identifier.name.c_str());
|
||||
|
||||
Reference in New Issue
Block a user