mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
(X11) Add preliminary stab at RARCH_DEVICE_MOUSE_SCREEN
This commit is contained in:
parent
20b8d592e1
commit
666c6849b7
@ -304,6 +304,21 @@ static int16_t x_mouse_state(x11_input_t *x11, unsigned id)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int16_t x_mouse_state_screen(x11_input_t *x11, unsigned id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case RETRO_DEVICE_ID_MOUSE_X:
|
||||
return x11->mouse_x;
|
||||
case RETRO_DEVICE_ID_MOUSE_Y:
|
||||
return x11->mouse_y;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return x_mouse_state(x11, id);
|
||||
}
|
||||
|
||||
static int16_t x_pointer_state(x11_input_t *x11,
|
||||
unsigned idx, unsigned id, bool screen)
|
||||
{
|
||||
@ -391,6 +406,8 @@ static int16_t x_input_state(void *data,
|
||||
|
||||
case RETRO_DEVICE_MOUSE:
|
||||
return x_mouse_state(x11, id);
|
||||
case RARCH_DEVICE_MOUSE_SCREEN:
|
||||
return x_mouse_state_screen(x11, id);
|
||||
|
||||
case RETRO_DEVICE_POINTER:
|
||||
case RARCH_DEVICE_POINTER_SCREEN:
|
||||
|
@ -248,11 +248,16 @@ static void zui_begin(void)
|
||||
zui->mouse.wheel = input_driver_state(binds, 0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_WHEELDOWN) -
|
||||
input_driver_state(binds, 0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_WHEELUP);
|
||||
|
||||
#if 0
|
||||
zui->mouse.x = input_driver_state(binds, 0, RARCH_DEVICE_MOUSE_SCREEN, 0, RETRO_DEVICE_ID_MOUSE_X);
|
||||
zui->mouse.y = input_driver_state(binds, 0, RARCH_DEVICE_MOUSE_SCREEN, 0, RETRO_DEVICE_ID_MOUSE_Y);
|
||||
#else
|
||||
dx = input_driver_state(binds, 0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_X);
|
||||
dy = input_driver_state(binds, 0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
|
||||
|
||||
zui->mouse.x += dx;
|
||||
zui->mouse.y += dy;
|
||||
#endif
|
||||
|
||||
zui->ca.coords.vertices = 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user