OSK bugfix when using mouse and joypad at the same time

This commit is contained in:
Jean-André Santoni 2016-10-30 18:09:23 +01:00
parent 7d0ebd1b51
commit 19c1b00bdc
3 changed files with 9 additions and 7 deletions

View File

@ -57,7 +57,7 @@ enum osk_type
};
static enum osk_type osk_idx = OSK_UPPERCASE_LATIN;
static unsigned osk_ptr;
static int osk_ptr;
static const char *osk_grid[41];
static const char *uppercase_grid[] = {
@ -96,12 +96,12 @@ static const char *katakana_page2_grid[] = {
"","","","","","","","","","",
"","","","","","","","","",""};
unsigned menu_event_get_osk_ptr()
int menu_event_get_osk_ptr()
{
return osk_ptr;
}
void menu_event_set_osk_ptr(unsigned i)
void menu_event_set_osk_ptr(int i)
{
osk_ptr = i;
}
@ -305,7 +305,8 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input)
if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_A))
{
input_keyboard_line_append(osk_grid[osk_ptr]);
if (osk_ptr >= 0)
input_keyboard_line_append(osk_grid[osk_ptr]);
}
if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_B))

View File

@ -39,8 +39,8 @@ void menu_event_keyboard_set(bool down, enum retro_key key);
unsigned char menu_event_keyboard_is_set(enum retro_key key);
unsigned menu_event_get_osk_ptr();
void menu_event_set_osk_ptr(unsigned);
int menu_event_get_osk_ptr();
void menu_event_set_osk_ptr(int);
const char** menu_event_get_osk_grid();
RETRO_END_DECLS

View File

@ -222,7 +222,8 @@ static int menu_input_mouse_frame(
if (settings->menu.mouse.enable)
ret = menu_input_mouse_post_iterate(&mouse_state, cbs, action);
if (menu_input_dialog_get_display_kb())
if (menu_input_dialog_get_display_kb() &&
(settings->menu.pointer.enable || settings->menu.mouse.enable))
{
menu_ctx_pointer_t point;
point.x = menu_input_mouse_state(MENU_MOUSE_X_AXIS);