diff --git a/src/pc/djui/djui_inputbox.c b/src/pc/djui/djui_inputbox.c index d1f85e66..662f8464 100644 --- a/src/pc/djui/djui_inputbox.c +++ b/src/pc/djui/djui_inputbox.c @@ -292,13 +292,13 @@ void djui_inputbox_on_key_up(UNUSED struct DjuiBase *base, int scancode) { } } -static void djui_inputbox_on_focus_begin(UNUSED struct DjuiBase* base) { +void djui_inputbox_on_focus_begin(UNUSED struct DjuiBase* base) { sHeldControl = 0; sHeldShift = 0; wm_api->start_text_input(); } -static void djui_inputbox_on_focus_end(UNUSED struct DjuiBase* base) { +void djui_inputbox_on_focus_end(UNUSED struct DjuiBase* base) { wm_api->stop_text_input(); } diff --git a/src/pc/djui/djui_inputbox.h b/src/pc/djui/djui_inputbox.h index ceceda2c..2b47b441 100644 --- a/src/pc/djui/djui_inputbox.h +++ b/src/pc/djui/djui_inputbox.h @@ -13,6 +13,8 @@ struct DjuiInputbox { void (*on_escape_press)(struct DjuiInputbox*); }; +void djui_inputbox_on_focus_begin(UNUSED struct DjuiBase* base); +void djui_inputbox_on_focus_end(UNUSED struct DjuiBase* base); void djui_inputbox_set_text_color(struct DjuiInputbox* inputbox, u8 r, u8 g, u8 b, u8 a); void djui_inputbox_set_text(struct DjuiInputbox* inputbox, char* text); void djui_inputbox_select_all(struct DjuiInputbox* inputbox); diff --git a/src/pc/djui/djui_panel_player.c b/src/pc/djui/djui_panel_player.c index 719c8070..a05d87b0 100644 --- a/src/pc/djui/djui_panel_player.c +++ b/src/pc/djui/djui_panel_player.c @@ -196,6 +196,7 @@ static void djui_panel_player_name_on_focus_end(struct DjuiBase* caller) { if (gNetworkType != NT_NONE) { network_send_player_settings(); } + djui_inputbox_on_focus_end(&inputbox1->base); } static void djui_panel_player_value_changed(UNUSED struct DjuiBase* caller) { @@ -255,7 +256,7 @@ void djui_panel_player_create(struct DjuiBase* caller) { djui_inputbox_set_text(inputbox1, DLANG(PLAYER, PLAYER)); } djui_interactable_hook_value_change(&inputbox1->base, djui_panel_player_name_text_change); - djui_interactable_hook_focus(&inputbox1->base, NULL, NULL, djui_panel_player_name_on_focus_end); + djui_interactable_hook_focus(&inputbox1->base, djui_inputbox_on_focus_begin, NULL, djui_panel_player_name_on_focus_end); } char* modelChoices[CT_MAX] = { 0 };