hs.mouse - fixes setMouseSpeed and adds trackpad support #3758
+62
−28
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.
Adds support for getting and setting trackpad speed
Fixes #3744
The issue was that the value would be changed, and reflected in the appropriate system preferences panel, but it wouldn't actually be applied so there was no change in mouse behavior. This fix uses the deprecated functions
IOHIDGetAccelerationWithKey
andIOHIDSetAccelerationWithKey
, but it works (for now).Tested with Sonoma 14.7.4, should be tested with Sequoia.
If I come across anything that shows how to force the UI to update the HID settings to match what is in the IOKit HID dictionary, I may try reverting this and fixing it in a more "modern" way, but atm this is the only way I've found that actually makes the change take effect immediately.
(see https://stackoverflow.com/questions/10448843/mac-mouse-trackpad-speed-programmatically and https://web.archive.org/web/20150513175725/http://lists.apple.com/archives/usb/2004/Aug/msg00056.html)