mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 16:20:27 +00:00
Call menu_driver_iterate another time for pointer/mouse controls
This commit is contained in:
parent
8c74be0879
commit
896a80d6b8
@ -1206,9 +1206,32 @@ void menu_input_post_iterate(int *ret, unsigned action)
|
||||
*ret |= menu_input_pointer_post_iterate(cbs, &entry, action);
|
||||
}
|
||||
|
||||
unsigned menu_input_frame_pointer(void)
|
||||
{
|
||||
unsigned ret = MENU_ACTION_NOOP;
|
||||
settings_t *settings = config_get_ptr();
|
||||
menu_input_t *menu_input = menu_input_get_ptr();
|
||||
bool mouse_enabled = settings->menu.mouse.enable;
|
||||
#ifdef HAVE_OVERLAY
|
||||
if (!mouse_enabled)
|
||||
mouse_enabled = !(settings->input.overlay_enable && input_overlay_is_alive());
|
||||
#endif
|
||||
|
||||
if (mouse_enabled)
|
||||
menu_input_mouse(&ret);
|
||||
else
|
||||
memset(&menu_input->mouse, 0, sizeof(menu_input->mouse));
|
||||
|
||||
if (settings->menu.pointer.enable)
|
||||
menu_input_pointer(&ret);
|
||||
else
|
||||
memset(&menu_input->pointer, 0, sizeof(menu_input->pointer));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned menu_input_frame_retropad(retro_input_t input, retro_input_t trigger_input, retro_input_t *devices)
|
||||
{
|
||||
bool mouse_enabled;
|
||||
float delta_time;
|
||||
unsigned ret = MENU_ACTION_NOOP;
|
||||
static bool initial_held = true;
|
||||
@ -1321,21 +1344,5 @@ unsigned menu_input_frame_retropad(retro_input_t input, retro_input_t trigger_in
|
||||
}
|
||||
#endif
|
||||
|
||||
mouse_enabled = settings->menu.mouse.enable;
|
||||
#ifdef HAVE_OVERLAY
|
||||
mouse_enabled = mouse_enabled ||
|
||||
!(settings->input.overlay_enable && input_overlay_is_alive());
|
||||
#endif
|
||||
|
||||
if (mouse_enabled)
|
||||
menu_input_mouse(&ret);
|
||||
else
|
||||
memset(&menu_input->mouse, 0, sizeof(menu_input->mouse));
|
||||
|
||||
if (settings->menu.pointer.enable)
|
||||
menu_input_pointer(&ret);
|
||||
else
|
||||
memset(&menu_input->pointer, 0, sizeof(menu_input->pointer));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -41,7 +41,9 @@ enum menu_action
|
||||
MENU_ACTION_START,
|
||||
MENU_ACTION_SCROLL_DOWN,
|
||||
MENU_ACTION_SCROLL_UP,
|
||||
MENU_ACTION_TOGGLE
|
||||
MENU_ACTION_TOGGLE,
|
||||
MENU_ACTION_POINTER_MOVED,
|
||||
MENU_ACTION_POINTER_PRESSED
|
||||
};
|
||||
|
||||
enum menu_mouse_action
|
||||
@ -118,6 +120,8 @@ void menu_input_st_string_callback(void *userdata, const char *str);
|
||||
|
||||
void menu_input_st_cheat_callback(void *userdata, const char *str);
|
||||
|
||||
unsigned menu_input_frame_pointer(void);
|
||||
|
||||
unsigned menu_input_frame_retropad(retro_input_t input, retro_input_t trigger_state, retro_input_t *devices_mask);
|
||||
|
||||
void menu_input_post_iterate(int *ret, unsigned action);
|
||||
|
12
runloop.c
12
runloop.c
@ -981,7 +981,17 @@ int rarch_main_iterate(unsigned *sleep_ms)
|
||||
#ifdef HAVE_MENU
|
||||
if (menu_driver_alive())
|
||||
{
|
||||
if (menu_driver_iterate((enum menu_action)menu_input_frame_retropad(input, trigger_input, &devices)) == -1)
|
||||
int ret2 = 0;
|
||||
enum menu_action action = (enum menu_action)menu_input_frame_retropad(input, trigger_input, &devices);
|
||||
/* Process RetroPad */
|
||||
int ret = menu_driver_iterate(action);
|
||||
|
||||
action = (enum menu_action)menu_input_frame_pointer();
|
||||
|
||||
if (action != MENU_ACTION_NOOP)
|
||||
ret2 = menu_driver_iterate(action);
|
||||
|
||||
if (ret == -1 || ret2 == -1)
|
||||
rarch_ctl(RARCH_ACTION_STATE_MENU_RUNNING_FINISHED, NULL);
|
||||
|
||||
if (!input && settings->menu.pause_libretro)
|
||||
|
Loading…
x
Reference in New Issue
Block a user