allow mouse input while mouse overlay is active (#17615)
This commit is contained in:
parent
273eb7bd7b
commit
e26b3bca4e
|
@ -401,31 +401,11 @@ static void cocoa_input_poll(void *data)
|
|||
if (!apple)
|
||||
return;
|
||||
|
||||
#ifdef IOS
|
||||
#ifdef HAVE_IOS_TOUCHMOUSE
|
||||
if (apple->window_pos_x > 0 || apple->mouse_grabbed)
|
||||
{
|
||||
apple->mouse_rel_x = apple->window_pos_x - apple->mouse_x_last;
|
||||
apple->mouse_x_last = apple->window_pos_x;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
apple->mouse_rel_x = apple->window_pos_x - apple->mouse_x_last;
|
||||
apple->mouse_x_last = apple->window_pos_x;
|
||||
#endif
|
||||
|
||||
#ifdef IOS
|
||||
#ifdef HAVE_IOS_TOUCHMOUSE
|
||||
if (apple->window_pos_y > 0 || apple->mouse_grabbed)
|
||||
{
|
||||
apple->mouse_rel_y = apple->window_pos_y - apple->mouse_y_last;
|
||||
apple->mouse_y_last = apple->window_pos_y;
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
apple->mouse_rel_y = apple->window_pos_y - apple->mouse_y_last;
|
||||
apple->mouse_y_last = apple->window_pos_y;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < apple->touch_count || i == 0; i++)
|
||||
{
|
||||
|
|
|
@ -1791,9 +1791,6 @@ static int16_t input_state_device(
|
|||
input_st->overlay_ptr, port, device, idx, id);
|
||||
#endif
|
||||
|
||||
if (input_st->flags & INP_FLAG_BLOCK_POINTER_INPUT)
|
||||
break;
|
||||
|
||||
if (id < RARCH_FIRST_META_KEY)
|
||||
{
|
||||
bool bind_valid = input_st->libretro_input_binds[port]
|
||||
|
@ -1807,7 +1804,7 @@ static int16_t input_state_device(
|
|||
res |= (1 << id);
|
||||
}
|
||||
else
|
||||
res = ret;
|
||||
res += ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -772,13 +772,31 @@ enum
|
|||
mouse.mouseInput.mouseMovedHandler = ^(GCMouseInput * _Nonnull mouse, float delta_x, float delta_y)
|
||||
{
|
||||
cocoa_input_data_t *apple = (cocoa_input_data_t*) input_state_get_ptr()->current_data;
|
||||
if (!apple || !apple->mouse_grabbed)
|
||||
if (!apple)
|
||||
return;
|
||||
apple->mouse_rel_x += (int16_t)delta_x;
|
||||
apple->mouse_rel_y -= (int16_t)delta_y;
|
||||
apple->window_pos_x += (int16_t)delta_x;
|
||||
apple->window_pos_y -= (int16_t)delta_y;
|
||||
};
|
||||
mouse.mouseInput.leftButton.pressedChangedHandler = ^(GCControllerButtonInput * _Nonnull button, float value, BOOL pressed)
|
||||
{
|
||||
cocoa_input_data_t *apple = (cocoa_input_data_t*) input_state_get_ptr()->current_data;
|
||||
if (!apple)
|
||||
return;
|
||||
if (pressed)
|
||||
apple->mouse_buttons |= (1 << 0);
|
||||
else
|
||||
apple->mouse_buttons &= ~(1 << 0);
|
||||
};
|
||||
mouse.mouseInput.rightButton.pressedChangedHandler = ^(GCControllerButtonInput * _Nonnull button, float value, BOOL pressed)
|
||||
{
|
||||
cocoa_input_data_t *apple = (cocoa_input_data_t*) input_state_get_ptr()->current_data;
|
||||
if (!apple)
|
||||
return;
|
||||
if (pressed)
|
||||
apple->mouse_buttons |= (1 << 1);
|
||||
else
|
||||
apple->mouse_buttons &= ~(1 << 1);
|
||||
};
|
||||
}];
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue