VoodooSMBus / VoodooRMI

Synaptic Trackpad driver over SMBus/I2C for macOS
GNU General Public License v2.0
232 stars 19 forks source link

Force Touch not respecting palm rejection rules. #167

Closed kanghengliu closed 1 year ago

kanghengliu commented 1 year ago

Describe the bug With PalmRejectionWidth set as 30, simple touch will not trigger input, however with ForceTouchType set as 2, Force Touch will trigger anywhere in the touchpad in spite of set width.

kanghengliu commented 1 year ago

I'm not sure if it's intended behavior, but I find it quite often to accidentally trigger Force Touch when typing. Modified code a lil bit but don't have Xcode yet to compile.

case RMI_FINGER_FORCE_TOUCH:{
                if (!isForceTouch(obj.z)) {
                    fingerState[i] = RMI_FINGER_VALID;
                    transducer.currentCoordinates.pressure = 0;
                    break;
                }
                // checks if it's in zone
                size_t zone = checkInZone(transducer);
                if (zone != 0) {
                    fingerState[i] = RMI_FINGER_INVALID;
                    break;
                }
                transducer.isPhysicalButtonDown = false;
                transducer.currentCoordinates = transducer.previousCoordinates;
                transducer.currentCoordinates.pressure = RMI_MT2_MAX_PRESSURE;
                break;
            }
case RMI_FINGER_INVALID:
                transducer.isTransducerActive = false;
                continue;
kanghengliu commented 1 year ago

Tested to be functional.