mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
Reimplement mouse input code - triggers 'select' callback
This commit is contained in:
parent
a805044aa3
commit
93ed2d60da
@ -732,10 +732,7 @@ static int menu_input_mouse_frame(
|
|||||||
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L))
|
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L))
|
||||||
{
|
{
|
||||||
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_TOGGLE))
|
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_TOGGLE))
|
||||||
return menu_entry_action(entry, nav->selection_ptr, MENU_ACTION_RIGHT);
|
return menu_entry_action(entry, nav->selection_ptr, MENU_ACTION_SELECT);
|
||||||
|
|
||||||
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_OK))
|
|
||||||
return menu_entry_action(entry, nav->selection_ptr, MENU_ACTION_OK);
|
|
||||||
|
|
||||||
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_SET_NAVIGATION))
|
if (BIT64_GET(input_mouse, MOUSE_ACTION_BUTTON_L_SET_NAVIGATION))
|
||||||
menu_navigation_set(nav, menu_input->mouse.ptr, false);
|
menu_navigation_set(nav, menu_input->mouse.ptr, false);
|
||||||
@ -781,12 +778,8 @@ static int menu_input_mouse_post_iterate(uint64_t *input_mouse,
|
|||||||
{
|
{
|
||||||
if (!menu_input->mouse.oldleft)
|
if (!menu_input->mouse.oldleft)
|
||||||
{
|
{
|
||||||
rarch_setting_t *setting = NULL;
|
|
||||||
|
|
||||||
BIT64_SET(*input_mouse, MOUSE_ACTION_BUTTON_L);
|
BIT64_SET(*input_mouse, MOUSE_ACTION_BUTTON_L);
|
||||||
|
|
||||||
setting = menu_setting_find(
|
|
||||||
menu_list->selection_buf->list[nav->selection_ptr].label);
|
|
||||||
menu_input->mouse.oldleft = true;
|
menu_input->mouse.oldleft = true;
|
||||||
|
|
||||||
if ((unsigned)menu_input->mouse.y < disp->header_height)
|
if ((unsigned)menu_input->mouse.y < disp->header_height)
|
||||||
@ -797,19 +790,10 @@ static int menu_input_mouse_post_iterate(uint64_t *input_mouse,
|
|||||||
if (
|
if (
|
||||||
(menu_input->mouse.ptr == nav->selection_ptr) &&
|
(menu_input->mouse.ptr == nav->selection_ptr) &&
|
||||||
cbs &&
|
cbs &&
|
||||||
cbs->action_right &&
|
cbs->action_select )
|
||||||
setting &&
|
|
||||||
(setting->type == ST_BOOL || setting->type == ST_UINT || setting->type == ST_FLOAT
|
|
||||||
|| setting->type == ST_STRING)
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
BIT64_SET(*input_mouse, MOUSE_ACTION_BUTTON_L_TOGGLE);
|
BIT64_SET(*input_mouse, MOUSE_ACTION_BUTTON_L_TOGGLE);
|
||||||
}
|
}
|
||||||
else if (menu_input->mouse.ptr == nav->selection_ptr
|
|
||||||
&& cbs && cbs->action_ok)
|
|
||||||
{
|
|
||||||
BIT64_SET(*input_mouse, MOUSE_ACTION_BUTTON_L_OK);
|
|
||||||
}
|
|
||||||
else if (menu_input->mouse.ptr <= menu_list_get_size(menu_list)-1)
|
else if (menu_input->mouse.ptr <= menu_list_get_size(menu_list)-1)
|
||||||
{
|
{
|
||||||
BIT64_SET(*input_mouse, MOUSE_ACTION_BUTTON_L_SET_NAVIGATION);
|
BIT64_SET(*input_mouse, MOUSE_ACTION_BUTTON_L_SET_NAVIGATION);
|
||||||
|
@ -66,7 +66,6 @@ enum mouse_action
|
|||||||
{
|
{
|
||||||
MOUSE_ACTION_NONE = 0,
|
MOUSE_ACTION_NONE = 0,
|
||||||
MOUSE_ACTION_BUTTON_L,
|
MOUSE_ACTION_BUTTON_L,
|
||||||
MOUSE_ACTION_BUTTON_L_OK,
|
|
||||||
MOUSE_ACTION_BUTTON_L_TOGGLE,
|
MOUSE_ACTION_BUTTON_L_TOGGLE,
|
||||||
MOUSE_ACTION_BUTTON_L_SET_NAVIGATION,
|
MOUSE_ACTION_BUTTON_L_SET_NAVIGATION,
|
||||||
MOUSE_ACTION_BUTTON_R,
|
MOUSE_ACTION_BUTTON_R,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user