Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a293a4d5 authored by Sergej Salnikov's avatar Sergej Salnikov Committed by Automerger Merge Worker
Browse files

Merge "InputDevice.hasKeys also checks for key usage" into udc-dev am: 216dd850

parents abf1ff29 216dd850
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -1072,16 +1072,8 @@ bool EventHub::markSupportedKeyCodes(int32_t deviceId, const std::vector<int32_t
    Device* device = getDeviceLocked(deviceId);
    if (device != nullptr && device->keyMap.haveKeyLayout()) {
        for (size_t codeIndex = 0; codeIndex < keyCodes.size(); codeIndex++) {
            std::vector<int32_t> scanCodes =
                    device->keyMap.keyLayoutMap->findScanCodesForKey(keyCodes[codeIndex]);

            // check the possible scan codes identified by the layout map against the
            // map of codes actually emitted by the driver
            for (const int32_t scanCode : scanCodes) {
                if (device->keyBitmask.test(scanCode)) {
            if (device->hasKeycodeLocked(keyCodes[codeIndex])) {
                outFlags[codeIndex] = 1;
                    break;
                }
            }
        }
        return true;