Add Magic Trackpad or Mouse upon (re)connection #49
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aBNBMouseDevice
in the I/O Registry. For example, the output ofioreg -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 aMultitouch ID
that corresponds to the ID produced byMTDeviceGetDeviceID
, and aFamily ID
that corresponds to the output ofMTDeviceGetFamilyID
. When such a device is connected, Jitouch's stored device list can be searched byMultitouch 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