From e316a966a507588cc3e4b4bda240f4b232159920 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 27 Feb 2014 05:25:33 +0100 Subject: [PATCH] (RGUI) Make it possible to map all binds from RGUI --- frontend/menu/menu_common.c | 5 +-- frontend/menu/menu_common.h | 35 ++++++++++++++++++-- frontend/menu/menu_settings.c | 62 +++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 6 deletions(-) diff --git a/frontend/menu/menu_common.c b/frontend/menu/menu_common.c index c89fbcb8fe..bd7f437146 100644 --- a/frontend/menu/menu_common.c +++ b/frontend/menu/menu_common.c @@ -2017,10 +2017,7 @@ void menu_populate_entries(void *data, unsigned menu_type) file_list_push(rgui->selection_buf, "Configure All (RetroPad)", RGUI_SETTINGS_CUSTOM_BIND_ALL, 0); file_list_push(rgui->selection_buf, "Default All (RetroPad)", RGUI_SETTINGS_CUSTOM_BIND_DEFAULT_ALL, 0); - if (rgui->current_pad == 0) - file_list_push(rgui->selection_buf, "RGUI Menu Toggle", RGUI_SETTINGS_BIND_MENU_TOGGLE, 0); - - last = (driver.input && driver.input->set_keybinds && !driver.input->get_joypad_driver) ? RGUI_SETTINGS_BIND_R3 : RGUI_SETTINGS_BIND_LAST; + last = (driver.input && driver.input->set_keybinds && !driver.input->get_joypad_driver) ? RGUI_SETTINGS_BIND_R3 : (RGUI_SETTINGS_BIND_MENU_TOGGLE+1); for (i = RGUI_SETTINGS_BIND_BEGIN; i <= last; i++) file_list_push(rgui->selection_buf, input_config_bind_map[i - RGUI_SETTINGS_BIND_BEGIN].desc, i, 0); break; diff --git a/frontend/menu/menu_common.h b/frontend/menu/menu_common.h index 678d6be955..7bbbc1e6cc 100644 --- a/frontend/menu/menu_common.h +++ b/frontend/menu/menu_common.h @@ -195,11 +195,42 @@ typedef enum RGUI_SETTINGS_BIND_ANALOG_RIGHT_X_MINUS, RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_PLUS, RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_MINUS, - RGUI_SETTINGS_BIND_LAST = RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_MINUS, - RGUI_SETTINGS_BIND_MENU_TOGGLE = RGUI_SETTINGS_BIND_BEGIN + RARCH_MENU_TOGGLE, + + RGUI_SETTINGS_BIND_FAST_FORWARD_KEY, + RGUI_SETTINGS_BIND_FAST_FORWARD_HOLD_KEY, + RGUI_SETTINGS_BIND_LOAD_STATE_KEY, + RGUI_SETTINGS_BIND_SAVE_STATE_KEY, + RGUI_SETTINGS_BIND_FULLSCREEN_TOGGLE_KEY, + RGUI_SETTINGS_BIND_QUIT_KEY, + RGUI_SETTINGS_BIND_STATE_SLOT_PLUS, + RGUI_SETTINGS_BIND_STATE_SLOT_MINUS, + RGUI_SETTINGS_BIND_REWIND, + RGUI_SETTINGS_BIND_MOVIE_RECORD_TOGGLE, + RGUI_SETTINGS_BIND_PAUSE_TOGGLE, + RGUI_SETTINGS_BIND_FRAMEADVANCE, + RGUI_SETTINGS_BIND_RESET, + RGUI_SETTINGS_BIND_SHADER_NEXT, + RGUI_SETTINGS_BIND_SHADER_PREV, + RGUI_SETTINGS_BIND_CHEAT_INDEX_PLUS, + RGUI_SETTINGS_BIND_CHEAT_INDEX_MINUS, + RGUI_SETTINGS_BIND_CHEAT_TOGGLE, + RGUI_SETTINGS_BIND_SCREENSHOT, + RGUI_SETTINGS_BIND_DSP_CONFIG, + RGUI_SETTINGS_BIND_MUTE, + RGUI_SETTINGS_BIND_NETPLAY_FLIP, + RGUI_SETTINGS_BIND_SLOWMOTION, + RGUI_SETTINGS_BIND_ENABLE_HOTKEY, + RGUI_SETTINGS_BIND_VOLUME_UP, + RGUI_SETTINGS_BIND_VOLUME_DOWN, + RGUI_SETTINGS_BIND_OVERLAY_NEXT, + RGUI_SETTINGS_BIND_DISK_EJECT_TOGGLE, + RGUI_SETTINGS_BIND_DISK_NEXT, + RGUI_SETTINGS_BIND_GRAB_MOUSE_TOGGLE, + RGUI_SETTINGS_BIND_MENU_TOGGLE, RGUI_SETTINGS_CUSTOM_BIND, RGUI_SETTINGS_CUSTOM_BIND_ALL, RGUI_SETTINGS_CUSTOM_BIND_DEFAULT_ALL, + RGUI_SETTINGS_BIND_LAST = RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_MINUS, RGUI_SETTINGS_CORE_OPTION_NONE = 0xffff, RGUI_SETTINGS_CORE_OPTION_START = 0x10000 diff --git a/frontend/menu/menu_settings.c b/frontend/menu/menu_settings.c index f54abb65e8..c8dd54a75f 100644 --- a/frontend/menu/menu_settings.c +++ b/frontend/menu/menu_settings.c @@ -954,7 +954,38 @@ int menu_set_settings(void *data, unsigned setting, unsigned action) case RGUI_SETTINGS_BIND_ANALOG_RIGHT_X_MINUS: case RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_PLUS: case RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_MINUS: + case RGUI_SETTINGS_BIND_FAST_FORWARD_KEY: + case RGUI_SETTINGS_BIND_FAST_FORWARD_HOLD_KEY: + case RGUI_SETTINGS_BIND_LOAD_STATE_KEY: + case RGUI_SETTINGS_BIND_SAVE_STATE_KEY: + case RGUI_SETTINGS_BIND_FULLSCREEN_TOGGLE_KEY: + case RGUI_SETTINGS_BIND_QUIT_KEY: + case RGUI_SETTINGS_BIND_STATE_SLOT_PLUS: + case RGUI_SETTINGS_BIND_STATE_SLOT_MINUS: + case RGUI_SETTINGS_BIND_REWIND: + case RGUI_SETTINGS_BIND_MOVIE_RECORD_TOGGLE: + case RGUI_SETTINGS_BIND_PAUSE_TOGGLE: + case RGUI_SETTINGS_BIND_FRAMEADVANCE: + case RGUI_SETTINGS_BIND_RESET: + case RGUI_SETTINGS_BIND_SHADER_NEXT: + case RGUI_SETTINGS_BIND_SHADER_PREV: + case RGUI_SETTINGS_BIND_CHEAT_INDEX_PLUS: + case RGUI_SETTINGS_BIND_CHEAT_INDEX_MINUS: + case RGUI_SETTINGS_BIND_CHEAT_TOGGLE: + case RGUI_SETTINGS_BIND_SCREENSHOT: + case RGUI_SETTINGS_BIND_DSP_CONFIG: + case RGUI_SETTINGS_BIND_MUTE: + case RGUI_SETTINGS_BIND_NETPLAY_FLIP: + case RGUI_SETTINGS_BIND_SLOWMOTION: + case RGUI_SETTINGS_BIND_ENABLE_HOTKEY: + case RGUI_SETTINGS_BIND_VOLUME_UP: + case RGUI_SETTINGS_BIND_VOLUME_DOWN: + case RGUI_SETTINGS_BIND_OVERLAY_NEXT: + case RGUI_SETTINGS_BIND_DISK_EJECT_TOGGLE: + case RGUI_SETTINGS_BIND_DISK_NEXT: + case RGUI_SETTINGS_BIND_GRAB_MOUSE_TOGGLE: case RGUI_SETTINGS_BIND_MENU_TOGGLE: + case RGUI_SETTINGS_BIND_MENU_TOGGLE+1: if (driver.input->set_keybinds && !driver.input->get_joypad_driver) { unsigned keybind_action = KEYBINDS_ACTION_NONE; @@ -2033,7 +2064,38 @@ void menu_set_settings_label(char *type_str, size_t type_str_size, unsigned *w, case RGUI_SETTINGS_BIND_ANALOG_RIGHT_X_MINUS: case RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_PLUS: case RGUI_SETTINGS_BIND_ANALOG_RIGHT_Y_MINUS: + case RGUI_SETTINGS_BIND_FAST_FORWARD_KEY: + case RGUI_SETTINGS_BIND_FAST_FORWARD_HOLD_KEY: + case RGUI_SETTINGS_BIND_LOAD_STATE_KEY: + case RGUI_SETTINGS_BIND_SAVE_STATE_KEY: + case RGUI_SETTINGS_BIND_FULLSCREEN_TOGGLE_KEY: + case RGUI_SETTINGS_BIND_QUIT_KEY: + case RGUI_SETTINGS_BIND_STATE_SLOT_PLUS: + case RGUI_SETTINGS_BIND_STATE_SLOT_MINUS: + case RGUI_SETTINGS_BIND_REWIND: + case RGUI_SETTINGS_BIND_MOVIE_RECORD_TOGGLE: + case RGUI_SETTINGS_BIND_PAUSE_TOGGLE: + case RGUI_SETTINGS_BIND_FRAMEADVANCE: + case RGUI_SETTINGS_BIND_RESET: + case RGUI_SETTINGS_BIND_SHADER_NEXT: + case RGUI_SETTINGS_BIND_SHADER_PREV: + case RGUI_SETTINGS_BIND_CHEAT_INDEX_PLUS: + case RGUI_SETTINGS_BIND_CHEAT_INDEX_MINUS: + case RGUI_SETTINGS_BIND_CHEAT_TOGGLE: + case RGUI_SETTINGS_BIND_SCREENSHOT: + case RGUI_SETTINGS_BIND_DSP_CONFIG: + case RGUI_SETTINGS_BIND_MUTE: + case RGUI_SETTINGS_BIND_NETPLAY_FLIP: + case RGUI_SETTINGS_BIND_SLOWMOTION: + case RGUI_SETTINGS_BIND_ENABLE_HOTKEY: + case RGUI_SETTINGS_BIND_VOLUME_UP: + case RGUI_SETTINGS_BIND_VOLUME_DOWN: + case RGUI_SETTINGS_BIND_OVERLAY_NEXT: + case RGUI_SETTINGS_BIND_DISK_EJECT_TOGGLE: + case RGUI_SETTINGS_BIND_DISK_NEXT: + case RGUI_SETTINGS_BIND_GRAB_MOUSE_TOGGLE: case RGUI_SETTINGS_BIND_MENU_TOGGLE: + case RGUI_SETTINGS_BIND_MENU_TOGGLE+1: input_get_bind_string(type_str, &g_settings.input.binds[rgui->current_pad][type - RGUI_SETTINGS_BIND_BEGIN], type_str_size); break; case RGUI_SETTINGS_AUDIO_VOLUME_LEVEL: