You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I wouldn't categorize this as a bug, but I cannot for the life of me figure out how to set the focus (first responder) to the main window containing the OKScene without clicking inside it first. The result is that key commands are not being picked up until you click anywhere in the scene. I'm sure it's something simple I'm missing.
// Steal the focus on macOS so the player doesn't have to click on the view before using the keyboard.
I'm not sure how reliable this trick is, though; try searching around the net for how to force a view to steal focus/become the First Responder, and let me know when you find a solution that works for all cases!
overridefunc didMove(to:SKView){
super.didMove(to: to)// from ShinryakuTako: Steal the focus on macOS so the player doesn't have to click on the view before using the keyboard.#if os(macOS)
to.window?.makeFirstResponder(self)#endif}
I will keep my eyes out for a more general solution. Thanks!
Category: 'Behavior'
Describe the bug
I wouldn't categorize this as a bug, but I cannot for the life of me figure out how to set the focus (first responder) to the main window containing the
OKScene
without clicking inside it first. The result is that key commands are not being picked up until you click anywhere in the scene. I'm sure it's something simple I'm missing.To Reproduce
Steps to reproduce the behavior:
Expected behavior
OKScene should be first responder when the scene is shown (I think)
Build Environment (what you're developing on)
- OctopusKit Version: '3.2.0'
- macOS Version: '10.15.7 (build)'
- Xcode Version: '12.0.1 (12A7300)'
- Swift Version: 'Apple Swift version 5.2.4'
Target Device (what you're compiling for)
- Device: 'macOS app'
- Target OS Version: 'macOS 10.15'
Additional context
Loving this framework... hope you like my app which builds heavily on OK!
The text was updated successfully, but these errors were encountered: