Windows – How to mouse events be caught in Windows when using Magic Trackpad


I have been trying to figure out how to "catch" three and four finger swipes from a trackpad to bind custom keyboard commands to them. I think also tap-to-click could be disabled in the same way.

My idea was to use Autohotkey to catch the signal and bind an action (or unaction) to that mouse input. The problem is that the default driver will not pass this info to the system.

Does anyone know how to get raw-input from the system to the mouse signals for Autohotkey in Windows? Some application, DLL, something else?

These codes are from default Autohotkey that I was able to catch from Magic Trackpad:

VK  SC  Type    Up/Dn   Elapsed Key
02  000     d   1.22    RButton         
02  000     u   0.00    RButton         
9E  001     d   2.15    WheelDown       
9E  001     d   0.03    WheelDown       
9F  001     d   1.22    WheelUp         
9F  001     d   0.02    WheelUp         
9D  001     d   1.83    WheelRight      
9D  001     d   0.00    WheelRight      
9C  001     d   1.22    WheelLeft       
9C  001     d   0.02    WheelLeft       

Using the above WheelLeft function I created Back-button for two finger swipe using the following function in Autohotkey:

 winc_presses = 1
 SetTimer, Whleft, 400 ; Wait for more presses within a 400 millisecond window.

 SetTimer, Whleft, off ; Disable timer after first time its called.
 if winc_presses >= 1 ; The key was pressed once or more.
  SendInput, !{Left} ; Send alt + left for back button (in Chrome at least)
 ; Regardless of which action above was triggered, reset the count to prepare for the next series of presses:
 winc_presses = 0

The 400 ms delay is used because sweeping causes several WheelLefts to be sent to the computer. This catches only the first of them during the 400 ms. We don't want to send the back command several times. Check out for a similar solution that has been done for Logitech MX1000.

So, does anyone know how to get other gestures from Magic Trackpad, so we could use it properly in Windows?

Best Answer

This is interesting: it seems apple is purposely hiding anything more than one finger and two finger input for the trackpad. I'm no expert in HID, but couldnt someone write their own driver for the trackpad that could then recieve the raw mouse data that is hidden when using apple drivers. You could try doing what this guy did and uninstall the apple drivers THEN try using autohotkey.

I would love to get full multitouch support for my magic trackpad on windows, shame apple is so insistent on not allowing windows users to have multitouch :/