Mac Mouse/Trackpad Speed Programmatically

泄露秘密 提交于 2019-12-05 21:48:44

Working example in swift:

func getAcceleration() -> Double {
    var speed:Double = 0
    IOHIDGetAccelerationWithKey(NXOpenEventStatus(), kIOHIDTrackpadAccelerationType, &speed)
    return speed
}

func setAcceleration(_ speed: Double) {
    IOHIDSetAccelerationWithKey(NXOpenEventStatus(), kIOHIDTrackpadAccelerationType, speed)
}

Source: http://lists.apple.com/archives/usb/2004/Aug/msg00056.html

You can try to make NSTrackingArea and change mouse position after you get new mouse position.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!