JitouchApp / Jitouch

A multi-touch extension for MacBook, Magic Mouse, and Magic Trackpad
GNU General Public License v3.0
391 stars 28 forks source link

Add Magic Trackpad or Mouse upon (re)connection #49

Closed aaronkollasch closed 1 year ago

aaronkollasch commented 1 year ago

On recent versions of macOS, or possibly on newer Apple devices, Jitouch does not respond to a newly connected Magic Trackpad or Magic Mouse without reloading all devices.

This is because the Magic Trackpad does not show up as a BNBTrackpadDevice, and the Magic Mouse does not show up as a BNBMouseDevice in the I/O Registry. For example, the output of ioreg -l -w 180 | grep -i BNBTrackpadDevice is empty even with a Magic Trackpad connected.

This prevents Jitouch from detecting when those devices are connected and disconnected, so it can't refresh its device list or add its callback to those devices.

Instead, Jitouch should watch for the connection of I/O devices named AppleMultitouchDevice, which have a Multitouch ID that corresponds to the ID produced by MTDeviceGetDeviceID, and a Family ID that corresponds to the output of MTDeviceGetFamilyID. When such a device is connected, Jitouch's stored device list can be searched by Multitouch ID and the matching device stopped, before starting a new device for that ID.

See the IOKitLib API and example ioreg outputs.

Fixes #28 and fixes #40 and fixes #46

aaronkollasch commented 1 year ago

Debug build linked below (updated 2022-11-13):

Install-Jitouch.zip