Create menu_input_set_input_device_bind_mode

This commit is contained in:
twinaphex 2015-04-14 13:43:24 +02:00
parent fc7f9894b8
commit 62a5d5338a
3 changed files with 19 additions and 14 deletions

View File

@ -193,7 +193,7 @@ void menu_input_key_event(bool down, unsigned keycode,
menu_input_search_start();
}
void menu_input_poll_bind_state(struct menu_bind_state *state)
static void menu_input_poll_bind_state(struct menu_bind_state *state)
{
unsigned i, b, a, h;
const rarch_joypad_driver_t *joypad = input_driver_get_joypad_driver();
@ -237,7 +237,7 @@ void menu_input_poll_bind_state(struct menu_bind_state *state)
}
}
void menu_input_poll_bind_get_rested_axes(struct menu_bind_state *state)
static void menu_input_poll_bind_get_rested_axes(struct menu_bind_state *state)
{
unsigned i, a;
const rarch_joypad_driver_t *joypad = input_driver_get_joypad_driver();
@ -384,6 +384,19 @@ int menu_input_set_keyboard_bind_mode(void)
return 0;
}
int menu_input_set_input_device_bind_mode(void)
{
menu_handle_t *menu = menu_driver_get_ptr();
if (!menu)
return -1;
menu_input_poll_bind_get_rested_axes(&menu->binds);
menu_input_poll_bind_state(&menu->binds);
return 0;
}
int menu_input_bind_iterate(void)
{
char msg[PATH_MAX_LENGTH];

View File

@ -58,10 +58,6 @@ void menu_input_st_string_callback(void *userdata, const char *str);
void menu_input_st_cheat_callback(void *userdata, const char *str);
void menu_input_poll_bind_get_rested_axes(struct menu_bind_state *state);
void menu_input_poll_bind_state(struct menu_bind_state *state);
bool menu_input_poll_find_trigger(struct menu_bind_state *state,
struct menu_bind_state *new_state);
@ -78,6 +74,8 @@ void menu_input_search_start(void);
int menu_input_set_keyboard_bind_mode(void);
int menu_input_set_input_device_bind_mode(void);
#ifdef __cplusplus
}
#endif

View File

@ -878,10 +878,7 @@ static int setting_action_ok_bind_all(void *data, unsigned action)
if (global->menu.bind_mode_keyboard)
menu_input_set_keyboard_bind_mode();
else
{
menu_input_poll_bind_get_rested_axes(&menu->binds);
menu_input_poll_bind_state(&menu->binds);
}
menu_input_set_input_device_bind_mode();
return 0;
}
@ -1086,10 +1083,7 @@ static int setting_bind_action_ok(void *data, unsigned action)
if (global->menu.bind_mode_keyboard)
menu_input_set_keyboard_bind_mode();
else
{
menu_input_poll_bind_get_rested_axes(&menu->binds);
menu_input_poll_bind_state(&menu->binds);
}
menu_input_set_input_device_bind_mode();
return 0;
}