(Menu) Refactor Onscreen Keyboard setting

This commit is contained in:
twinaphex 2014-07-21 23:03:14 +02:00
parent 79af6d1b45
commit 5a09711427
2 changed files with 17 additions and 6 deletions

View File

@ -576,7 +576,11 @@ static void menu_common_entries_init(void *data, unsigned menu_type)
file_list_push(menu->selection_buf, "Configure All (RetroPad)", MENU_SETTINGS_CUSTOM_BIND_ALL, 0);
file_list_push(menu->selection_buf, "Default All (RetroPad)", MENU_SETTINGS_CUSTOM_BIND_DEFAULT_ALL, 0);
#ifdef HAVE_OSK
file_list_push(menu->selection_buf, "Onscreen Keyboard Enable", MENU_SETTINGS_ONSCREEN_KEYBOARD_ENABLE, 0);
if ((current_setting = setting_data_find_setting(setting_data, "osk_enable")))
{
*current_setting->value.boolean = g_settings.input.autodetect_enable;
file_list_push(menu->selection_buf, current_setting->short_description, MENU_SETTINGS_ONSCREEN_KEYBOARD_ENABLE, 0);
}
#endif
last = (driver.input && driver.input->set_keybinds && !driver.input->get_joypad_driver) ? (MENU_SETTINGS_BIND_BEGIN + RETRO_DEVICE_ID_JOYPAD_R3) : MENU_SETTINGS_BIND_ALL_LAST;
for (i = MENU_SETTINGS_BIND_BEGIN; i <= last; i++)
@ -2612,7 +2616,6 @@ static int menu_common_iterate(unsigned action)
#endif
if (menu_type == MENU_SETTINGS_DEFERRED_CORE)
{
// FIXME: Add for consoles.
strlcpy(g_settings.libretro, path, sizeof(g_settings.libretro));
strlcpy(g_extern.fullpath, driver.menu->deferred_path, sizeof(g_extern.fullpath));
load_menu_game_new_core();
@ -4799,10 +4802,8 @@ static int menu_common_setting_set(unsigned setting, unsigned action)
#endif
#ifdef HAVE_OSK
case MENU_SETTINGS_ONSCREEN_KEYBOARD_ENABLE:
if (action == MENU_ACTION_OK || action == MENU_ACTION_LEFT || action == MENU_ACTION_RIGHT)
g_settings.osk.enable = !g_settings.osk.enable;
else if (action == MENU_ACTION_START)
g_settings.osk.enable = false;
if ((current_setting = (rarch_setting_t*)setting_data_find_setting(setting_data, "osk_enable")))
menu_common_setting_set_current_boolean(current_setting, action);
break;
#endif
case MENU_SETTINGS_PRIVACY_CAMERA_ALLOW:

View File

@ -766,6 +766,10 @@ static void general_change_handler(const void *data)
g_settings.load_dummy_on_core_shutdown = *setting->value.boolean;
else if (!strcmp(setting->name, "libretro_log_level"))
g_settings.libretro_log_level = *setting->value.unsigned_integer;
#ifdef HAVE_OSK
else if (!strcmp(setting->name, "osk_enable"))
g_settings.osk.enable = *setting->value.boolean;
#endif
}
#define NEXT (list[index++])
@ -1044,6 +1048,12 @@ rarch_setting_t* setting_data_get_list(void)
}
END_SUB_GROUP()
}
#ifdef HAVE_OSK
START_SUB_GROUP("Onscreen Keyboard")
CONFIG_BOOL(g_settings.osk.enable, "osk_enable", "Onscreen Keyboard Enable", false, GROUP_NAME, SUBGROUP_NAME, general_change_handler)
END_SUB_GROUP()
#endif
START_SUB_GROUP("Miscellaneous")
CONFIG_BOOL(g_settings.input.netplay_client_swap_input, "netplay_client_swap_input", "Swap Netplay Input", netplay_client_swap_input, GROUP_NAME, SUBGROUP_NAME, general_change_handler)
END_SUB_GROUP()