Skip to content
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

[Switch] Fix OS_Switch::show_virtual_keyboard #8

Merged
merged 5 commits into from
Jan 20, 2024

Conversation

hokaze
Copy link

@hokaze hokaze commented Jan 20, 2024

Implementation of OS_Switch::show_virtual_keyboard is wrong, arguments list doesn't match the format os.show_virtual_keyboard expects:

os.h
virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), bool p_multiline = false, int p_max_input_length = -1, int p_cursor_start = -1, int p_cursor_end = -1);

os_switch.h:
virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), int p_max_input_length = -1);

This is why the show_virtual_keyboard method never executes any of the code within, despite everything else about the inline software keyboard from libnx otherwise largely working.

- was missing the p_multiline, p_cursor_start and p_cursor_end args
(don't urgently need to do anything with those vars, the software keyboard already appears to handle cursor position for editing in the middle of text if that's where you press the touch screen first)
- keyboard height is actually 400, and now reports as such
- removed old printf debugging for hiding software keyboard, it's one of the only places where that remains and shouldn't still be present in release
@halotroop2288 halotroop2288 changed the title Fix Switch virtual keyboard not showing due to missing args in OS_Switch::show_virtual_keyboard [Switch] Fix OS_Switch::show_virtual_keyboard Jan 20, 2024
@halotroop2288 halotroop2288 added the bug Something isn't working label Jan 20, 2024
platform/switch/os_switch.cpp Outdated Show resolved Hide resolved
platform/switch/os_switch.cpp Outdated Show resolved Hide resolved
hokaze and others added 4 commits January 20, 2024 06:31
- removed remaining printf debug on showing keyboard
- restored swkbdInlineUpdate in main loop to original position after flushing event buffer
(after confirming that running it before is not needed for it to work, like first thought)
- restored original indentation, previous commits used spaces instead of tabs
@hokaze
Copy link
Author

hokaze commented Jan 20, 2024

Thanks for doing the cleanup, I somehow completely missed that I hadn't actually removed the printf or the other lines with wrong indents.

I'm taking this as a learning experience for next time, namely to keep in mind the style conventions and not just autopilot there, to review my changes more thoroughly before pushing and to probably do any further coding when more rested and not rocking 2 nights insomnia in a row 😅

@halotroop2288 halotroop2288 merged commit 6b1fb9c into Homebrodot:main/3.5 Jan 20, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants