-
Notifications
You must be signed in to change notification settings - Fork 2
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
[3.5 | Switch] Create Switch API for virtual keyboards #10
[3.5 | Switch] Create Switch API for virtual keyboards #10
Conversation
1729dc9
to
394799c
Compare
394799c
to
4e5e1e6
Compare
eed976f
to
f7a5b0b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured out why the keyboard wasn't showing in the test suite.
When the code was moved over from os_switch.cpp to api.cpp, there's some code for initialising the software keyboard that was shifted out of OS_Switch::run and into NintendoSwitch::initialize_software_keyboard():
...however, the initialize_software_keyboard() method isn't actually called anywhere, so the keyboard never gets setup properly.
In my own local changes to test and confirm this theory, I just put
NintendoSwitch::get_singleton()->initialize_software_keyboard();
On line 351 of os_switch.cpp below main_loop->init(), as that's where that code was previous to being moved to that method.
Other Issues I've just spotted:
- For some reason, the first 2 characters of the TextEdit node can't be deleted, the keyboard acts as if it can't go any further left, either when deleting or when using L/R to move the cursor left/right
- when focusing on the textedit to open the keyboard, I often get it automatically adding either an extra "g" or whatever the last character that was typed onto the end, sometimes 2 of such characters. They can be deleted as normal, but it only happens when the textedit is focused, not when opening the number pad
- more a complaint with the libnx docs, but I have no idea what the difference is between the all languages keyboard and the default one opened on focusing the textedit - both have the same sets of characters by default and both have the option in the bottom left to change the keyboard layout
- switch keyboard layout to other languages has the layout update correctly, but the actual characters entered into the text edit don't match the updated layout - tested this with german and japanese hiragana keysets, a lot of the time they just put Ã, a space, a unicode character like ©, etc instead of the actual character selected - this could be a problem with either the keyboard or with the text encoding on the textedit (although I think Godot uses UTF-8 by default, so should normally be fine)
I didn't notice anything massively amiss with the numpad, at least?
Don't have any lead on the keyboard inserting phantom keypresses or not letting you navigate all the way to the start of the string, as I didn't encounter either of those issues on the initial PR we did together for fixing Switch virtual keyboard
f7a5b0b
to
bc9cb1b
Compare
bc9cb1b
to
e4df804
Compare
The check needed to be for string length greater than zero, not any length other than zero. That's how we were getting erroneous characters when it started. |
e4df804
to
8675db0
Compare
8675db0
to
5eff1ee
Compare
OK, I'm going to merge this for now just to get it over with. It works perfectly the way it is, but my next PR will likely move this to its own module. I just want to have it out of the way for now. This API should be considered UNSTABLE just for now. But I intend to fix it before the next release. |
Adds a new
NintendoSwitch
global singleton for opening different types of virtual keyboard supported by Horizon OS.This can be expanded to support other Switch-specific features later on.
I also went ahead and fixed a few bugs with the
.gitignore
.