-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
iOS RoboVM: Support hardware keyboard events #6132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… hardware keyboards
That makes sense. Unless there are any objections +1 to have this merged. Maybe best to update the CHANGES file also incl. that RoboVM 2.3.10+ is required. |
Reason why I normally don't change CHANGES is that it typically causes conflicts to the PRs, especially because no one knows if or when a PR is to be merged. In this case I additionaly don't know if it is acceptable to depend on a snapshot. I would like it more to depend on a stable 2.3.10 (which could be done soon because in my experiences the current snapshot version is a good release candidate), but that's something @Tom-Ski should decide and comment on. |
It's merged! Please update the CHANGES file to and indicate that RoboVM 2.3.10+ is required. - Thanks! 👍 |
Thanks, done! |
Line 5 in cca4726
|
I am sorry, was not aware of a second definition. There are still some more. |
The dependencies are updated, unfortunately using snapshots does not work in fetch.xml :( |
Since iOS 13.5, iOS gives us real key events from hardware keyboards. I've added that to our robovm backend.
It is downwards compatible, older iOS versions since 9 have the used callback but don't call it (it was used on tvOS only) and therefore on older iOS versions nothing happens. But the game must be build with iOS SDK 13.5 or newer, that means robovm 2.3.10 is needed and therefore the dependency changed.
Since key event handling is used very different in libGDX (keys vs keyTyped, polling vs event handling, not to speak about Scene2d text fields, I was not able to test every type of key input. However, I tested with my game, with InputTest and SoftKeyboardTest on iOS 12, 13.2 and 13.4. As this is an addition, situation is in any case better with than without it. :-)
EDIT: Can be tested conveniently on Simulator.
Hint: iOS 14 will add the ability to access hardware keyboard connection state and handle mouse events/lock mouse cursor as well.