Post not yet marked as solved
Post marked as unsolved with 0 replies, 309 views
Using the GameController framework to receive raw mouse-movement input does not work for me on an Intel Mac with Big Sur.
I can replicate it by simply creating a new Swift application in Xcode and modifying the AppDelegate like this:
func applicationDidFinishLaunching(_ aNotification: Notification)
{
NotificationCenter.default.addObserver(forName: .GCMouseDidConnect, object: nil, queue: nil) { note in
let mouse = note.object as? GCMouse
mouse?.mouseInput?.mouseMovedHandler = { mouseInput, deltaX, deltaY in
NSLog("%1.1f|%1.1f", deltaX, deltaY)
}
}
}
While the GCMouseDidConnect notification will be received, the mouseMovedHandler code will never be called on my Mac mini 2018 with macOS 11.6, but the same code will run perfectly fine on my Apple Silicon MacBook Pro with macOS 12.0.1.
I couldn't find anything about why this code won't work looking it up, the whole topic of mouse input via the GameController framework seems to be not much talked about.
Before filing a bug report I wanted to make sure that the problem isn't on my side. With code that simple, I just can't find anything I might be missing.