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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions platform/switch/os_switch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,10 @@ void OS_Switch::run() {
}
}

swkbdInlineUpdate(&inline_keyboard, NULL);
halotroop2288 marked this conversation as resolved.
Show resolved Hide resolved
joypad->process();
input->flush_buffered_events();

swkbdInlineUpdate(&inline_keyboard, NULL);

if (Main::iteration())
break;
}
Expand All @@ -478,15 +477,15 @@ bool OS_Switch::has_virtual_keyboard() const {
}

int OS_Switch::get_virtual_keyboard_height() const {
// todo: actually figure this out
if (!g_swkbd_open) {
return 0;
}
return 300;
return 400;
}

void OS_Switch::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, int p_max_input_length) {
if (!g_swkbd_open) {
void OS_Switch::show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect, bool p_multiline, int p_max_input_length, int p_cursor_start, int p_cursor_end) {
printf("Showing kbd!\n");
halotroop2288 marked this conversation as resolved.
Show resolved Hide resolved
if (!g_swkbd_open) {
g_swkbd_open = true;

SwkbdAppearArg appear_arg;
Expand All @@ -501,7 +500,6 @@ void OS_Switch::show_virtual_keyboard(const String &p_existing_text, const Rect2
}

void OS_Switch::hide_virtual_keyboard() {
printf("Hiding kbd!\n");
g_swkbd_open = false;
swkbdInlineDisappear(&inline_keyboard);
}
Expand Down
2 changes: 1 addition & 1 deletion platform/switch/os_switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class OS_Switch : public OS {
virtual bool has_touchscreen_ui_hint() const;

virtual bool has_virtual_keyboard() const;
virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2(), int p_max_input_length = -1);
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);
virtual void hide_virtual_keyboard();
virtual int get_virtual_keyboard_height() const;

Expand Down
Loading