Mac / Trackpad Mouse Programmatically Speed

I am trying to change the mouse tracking speed (note: not acceleration) for the application I'm working on. I have always looked for a way to do this, but could not find anything. I suspect this is due to the value that I provide in this function on the IOKit / hidsystem Framework:

IOHIDSetAccelerationWithKey(handle, CFSTR(kIOHIDMouseAccelerationType), mouseAcceleration);

Being a mouseAcceleration, I suspect there is a hexadecimal value that determines both acceleration and speed.

Has anyone encountered this problem and could help me?

Thanks in advance

+3
source share
2 answers

Working example in fast mode:

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

+1
source
-1

All Articles