mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 12:32:52 +00:00
Reimplement custom bind mode setting
This commit is contained in:
parent
8167c81d38
commit
15201318da
@ -536,11 +536,6 @@ int menu_action_setting_set(unsigned id, const char *label,
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case MENU_SETTINGS_CUSTOM_BIND_MODE:
|
||||
if (action == MENU_ACTION_LEFT || action == MENU_ACTION_RIGHT)
|
||||
driver.menu->bind_mode_keyboard =
|
||||
!driver.menu->bind_mode_keyboard;
|
||||
break;
|
||||
#if defined(GEKKO)
|
||||
case MENU_SETTINGS_VIDEO_RESOLUTION:
|
||||
if (action == MENU_ACTION_LEFT)
|
||||
|
@ -182,7 +182,7 @@ static int push_list(menu_handle_t *menu,
|
||||
bool do_action = false;
|
||||
bool is_history_list = !strcmp(label, "history_list");
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
RARCH_LOG("Label is: %s\n", label);
|
||||
RARCH_LOG("Path is: %s\n", path);
|
||||
RARCH_LOG("Menu type is: %d\n", menu_type);
|
||||
@ -767,7 +767,7 @@ static int menu_parse_list(file_list_t *list, file_list_t *menu_list,
|
||||
|
||||
static int menu_parse_check(const char *label, unsigned menu_type)
|
||||
{
|
||||
#if 1
|
||||
#if 0
|
||||
RARCH_LOG("label is menu_parse_check: %s\n", label);
|
||||
#endif
|
||||
bool check = (!((menu_type == MENU_FILE_DIRECTORY ||
|
||||
@ -798,7 +798,7 @@ int menu_entries_deferred_push(file_list_t *list, file_list_t *menu_list)
|
||||
|
||||
file_list_get_last(menu_list, &path, &label, &type);
|
||||
|
||||
#if 1
|
||||
#if 0
|
||||
RARCH_LOG("label: %s\n", label);
|
||||
#endif
|
||||
|
||||
|
@ -657,10 +657,16 @@ static int disk_options_disk_index_toggle(unsigned type, const char *label,
|
||||
{
|
||||
int step = 0;
|
||||
|
||||
if (action == MENU_ACTION_RIGHT || action == MENU_ACTION_OK)
|
||||
step = 1;
|
||||
else if (action == MENU_ACTION_LEFT)
|
||||
step = -1;
|
||||
switch (action)
|
||||
{
|
||||
case MENU_ACTION_LEFT:
|
||||
step = -1;
|
||||
break;
|
||||
case MENU_ACTION_RIGHT:
|
||||
case MENU_ACTION_OK:
|
||||
step = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (step)
|
||||
{
|
||||
@ -679,6 +685,23 @@ static int disk_options_disk_index_toggle(unsigned type, const char *label,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int custom_bind_mode_toggle(unsigned type, const char *label,
|
||||
unsigned action)
|
||||
{
|
||||
if (!driver.menu)
|
||||
return -1;
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case MENU_ACTION_LEFT:
|
||||
case MENU_ACTION_RIGHT:
|
||||
driver.menu->bind_mode_keyboard = !driver.menu->bind_mode_keyboard;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int action_start_bind(unsigned type, const char *label,
|
||||
unsigned action)
|
||||
{
|
||||
@ -879,8 +902,16 @@ static void menu_entries_cbs_init_bind_toggle(menu_file_list_cbs_t *cbs,
|
||||
else if (type >= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_BEGIN &&
|
||||
type <= MENU_SETTINGS_LIBRETRO_PERF_COUNTERS_END)
|
||||
cbs->action_toggle = performance_counters_core_toggle;
|
||||
else if (type == MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_INDEX)
|
||||
cbs->action_toggle = disk_options_disk_index_toggle;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case MENU_SETTINGS_CORE_DISK_OPTIONS_DISK_INDEX:
|
||||
cbs->action_toggle = disk_options_disk_index_toggle;
|
||||
break;
|
||||
case MENU_SETTINGS_CUSTOM_BIND_MODE:
|
||||
cbs->action_toggle = custom_bind_mode_toggle;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void menu_entries_cbs_init(void *data,
|
||||
|
Loading…
x
Reference in New Issue
Block a user