Posts

Post not yet marked as solved
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.
Posted Last updated
.
Post not yet marked as solved
0 Replies
479 Views
Hello World! I've been finally able to make the jump from legacy hardware (with macOS 10.14) to Big Sur, and even though I'm a Big Fan mostly, I quite dislike a particular problem this has caused me. Like the title says, I make use of IOKit's IOHIDManager interface to receive user inputs. I've used that mostly for game controller inputs and raw mouse movement, but also liked how I'm able to address multiple keyboards and mice independently this way. This is mostly done in C++, so no (direct) access to higher-level APIs. With Big Sur (or Catalina, as far as I'm aware) the user is now prompted to explicitly allow my app to receive keystrokes from all processes as soon as I call IOHIDManagerOpen. That's not my complaint, in fact I agree with macOS, the user should be prompted about this! My problem however is that I'm not interested in what the user is being warned here. I can already guess the answer, but is there a way to avoid this breach of security using the IOHID interfaces and therefore prevent macOS to bother (and possibly scare) the user? I'm aware of Apple's Game Controller framework, but it's difficult to use this while also supporting earlier macOS versions. Many thanks in advance!
Posted Last updated
.