Skip to content

Commit

Permalink
Implement 0.5s palm rejection
Browse files Browse the repository at this point in the history
  • Loading branch information
yusufrahadika authored and usr-sse2 committed Apr 18, 2019
1 parent 28a90da commit b99c3d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions VoodooPS2Trackpad/VoodooPS2SynapticsTouchPad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,11 @@ void ApplePS2SynapticsTouchPad::assignVirtualFinger(int physicalFinger) {

void ApplePS2SynapticsTouchPad::synaptics_parse_hw_state(const UInt8 buf[])
{

// Check if input is disabled via ApplePS2Keyboard request
if (ignoreall)
return;

int w = (((buf[0] & 0x30) >> 2) |
((buf[0] & 0x04) >> 1) |
((buf[3] & 0x04) >> 2));
Expand Down Expand Up @@ -1226,8 +1231,14 @@ void ApplePS2SynapticsTouchPad::sendTouchData() {

DEBUG_LOG("synaptics_parse_hw_state lastFingerCount=%d clampedFingerCount=%d", lastFingerCount, clampedFingerCount);

// Ignore input for specified time after keyboard usage
AbsoluteTime timestamp;
clock_get_uptime(&timestamp);
uint64_t timestamp_ns;
absolutetime_to_nanoseconds(timestamp, &timestamp_ns);

if (timestamp_ns - keytime < maxaftertyping)
return;

int transducers_count = 0;
for(int i = 0; i < SYNAPTICS_MAX_FINGERS; i++) {
Expand Down

1 comment on commit b99c3d3

@zzzhuzhang
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disable the touchpad during typing. 10.15.4 has been invalidated. When typing, the touchpad will be touched by mistake without delay of 500ms!

Please sign in to comment.