Skip to content

Commit

Permalink
Improve key time dispatch (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
hieplpvip authored Oct 1, 2020
1 parent f0797ce commit bcc187d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
2 changes: 1 addition & 1 deletion VoodooPS2Controller/VoodooPS2Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2012,7 +2012,7 @@ void ApplePS2Controller::dispatchMessageGated(int* message, void* data)

switch (pInfo->adbKeyCode)
{
// Do not trigger on modifier key presses (for example multi-click select)
// Do not trigger on modifier key presses (for example multi-click select)
case 0x38: // left shift
case 0x3c: // right shift
case 0x3b: // left control
Expand Down
20 changes: 2 additions & 18 deletions VoodooPS2Mouse/VoodooPS2Mouse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,27 +1263,11 @@ IOReturn ApplePS2Mouse::message(UInt32 type, IOService* provider, void* argument
break;
}

case kPS2M_notifyKeyPressed:
case kPS2M_notifyKeyTime:
{
// just remember last time key pressed... this can be used in
// interrupt handler to detect unintended input while typing
PS2KeyInfo* pInfo = (PS2KeyInfo*)argument;
switch (pInfo->adbKeyCode)
{
// don't store key time for modifier keys going down
case 0x38: // left shift
case 0x3c: // right shift
case 0x3b: // left control
case 0x3e: // right control
case 0x3a: // left alt (command)
case 0x3d: // right alt
case 0x37: // left windows (option)
case 0x36: // right windows
if (pInfo->goingDown)
break;
default:
keytime = pInfo->time;
}
keytime = *((uint64_t*)argument);
break;
}
}
Expand Down
5 changes: 2 additions & 3 deletions VoodooPS2Trackpad/VoodooPS2Elan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,11 @@ IOReturn ApplePS2Elan::message(UInt32 type, IOService* provider, void* argument)
break;
}

case kPS2M_notifyKeyPressed:
case kPS2M_notifyKeyTime:
{
// just remember last time key pressed... this can be used in
// interrupt handler to detect unintended input while typing
PS2KeyInfo* pInfo = (PS2KeyInfo*)argument;
keytime = pInfo->time;
keytime = *((uint64_t*)argument);
break;
}
}
Expand Down

0 comments on commit bcc187d

Please sign in to comment.