(X11) Add preliminary stab at RARCH_DEVICE_MOUSE_SCREEN

This commit is contained in:
twinaphex 2015-10-08 09:52:31 +02:00
parent 20b8d592e1
commit 666c6849b7
2 changed files with 22 additions and 0 deletions

View File

@ -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:

View File

@ -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;