1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2025-01-31 23:52:14 +01:00

fixed mouse input

This commit is contained in:
yours3lf 2020-05-20 23:54:30 +01:00
parent 027b750129
commit 112d3e8a7e

View File

@ -96,11 +96,18 @@ void handleInput()
printf("Keypress keycode %u state %u\n", keyCode, keyState); printf("Keypress keycode %u state %u\n", keyCode, keyState);
break; break;
} }
case LIBINPUT_EVENT_POINTER_MOTION:
{
double xCoord = libinput_event_pointer_get_dx(libinput_event_get_pointer_event(event));
double yCoord = libinput_event_pointer_get_dy(libinput_event_get_pointer_event(event));
printf("Pointer relative motion xcoord %lf ycoord %lf\n", xCoord, yCoord);
break;
}
case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE: case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE:
{ {
double xCoord = libinput_event_pointer_get_absolute_x(libinput_event_get_pointer_event(event)); double xCoord = libinput_event_pointer_get_absolute_x(libinput_event_get_pointer_event(event));
double yCoord = libinput_event_pointer_get_absolute_y(libinput_event_get_pointer_event(event)); double yCoord = libinput_event_pointer_get_absolute_y(libinput_event_get_pointer_event(event));
printf("Pointer motion xcoord %lf ycoord %lf\n", xCoord, yCoord); printf("Pointer absolute motion xcoord %lf ycoord %lf\n", xCoord, yCoord);
break; break;
} }
case LIBINPUT_EVENT_POINTER_BUTTON: case LIBINPUT_EVENT_POINTER_BUTTON: