Skip to content

Conversation

@asmagill
Copy link
Member

@asmagill asmagill commented Mar 9, 2025

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 and IOHIDSetAccelerationWithKey, 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)

@asmagill asmagill added pr-fix Pull Request implementing a bug fix pr-feature Pull Request implementing a feature labels Mar 9, 2025
@codecov
Copy link

codecov bot commented Mar 9, 2025

Codecov Report

Attention: Patch coverage is 79.31034% with 6 lines in your changes missing coverage. Please review.

Project coverage is 27.43%. Comparing base (20f27e5) to head (377af82).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3758      +/-   ##
==========================================
+ Coverage   27.06%   27.43%   +0.36%     
==========================================
  Files         191      191              
  Lines       51460    51471      +11     
==========================================
+ Hits        13926    14119     +193     
+ Misses      37534    37352     -182     
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature Pull Request implementing a feature pr-fix Pull Request implementing a bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Applying the hs.mouse.trackingSpeed() setting

1 participant