Hello everyone, I am debugging an iPadOS/iOS app on XCode and want to run it on Mac directly (choose "My Mac (Designed for iPad)"). Everything is all right except for the input.
When I press any key on my MacBook's keyboard or the mouse button on my connected mouse,
I never accept any callback events (no print and no breakpoint worked in the handler callback block) via the GCMouse.current.mouseMovedHandler
and GCKeyboard.coalesedKeyboard.keyboardInput.valueChangeHandler
, while they seem to be registered successfully. (The same code works if I build and run an app on iPad connected with bluetooth keyboard and mouse.)
GCKeyboard.coalesedKeyboard
and GCMouse.current
are not nil, and I can accept GCkeyboardDidConnectNotification
and GCMouseDidConnectNotification
events.
But if I connect multi keyboards, I receive connect notification only once.
And printf("%d", (int)keyboardInput.anyKeyPressed)
in my Update Function is always "0"(false).
However, the callback in UIKit - (void)pressesBegan:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
works. Is GameController
not support MacBook's native keyboard and mouse input?
System Version: macOS Monterey 12.6
Device: MacBookPro(13-inch, M1, 2020)
XCode Version: 13.3.1
(Besides, when I connect the xbox/ps4 joystick, the GCController
input handler work but will have very long delay. It's another question.)