Implemented horizontal mouse wheel for wayland.

This commit is contained in:
Armin Novak 2018-12-18 13:30:13 +01:00
parent f647e5cc3f
commit 1984f73db8

View File

@ -97,7 +97,7 @@ BOOL wlf_handle_pointer_buttons(freerdp* instance, UwacPointerButtonEvent* ev)
BOOL wlf_handle_pointer_axis(freerdp* instance, UwacPointerAxisEvent* ev)
{
rdpInput* input;
UINT16 flags;
UINT16 flags = 0;
int direction;
if (!instance || !ev || !instance->input)
@ -106,16 +106,26 @@ BOOL wlf_handle_pointer_axis(freerdp* instance, UwacPointerAxisEvent* ev)
input = instance->input;
flags = PTR_FLAGS_WHEEL;
if (ev->axis == WL_POINTER_AXIS_VERTICAL_SCROLL)
switch (ev->axis)
{
direction = wl_fixed_to_int(ev->value);
case WL_POINTER_AXIS_VERTICAL_SCROLL:
flags |= PTR_FLAGS_WHEEL;
break;
if (direction < 0)
flags |= 0x0078;
else
flags |= PTR_FLAGS_WHEEL_NEGATIVE | 0x0088;
case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
flags |= PTR_FLAGS_HWHEEL;
break;
default:
return FALSE;
}
direction = wl_fixed_to_int(ev->value);
flags |= 0x0078; /* TODO: Calculate the distance with the provided value size */
if (direction > 0)
flags |= PTR_FLAGS_WHEEL_NEGATIVE;
return freerdp_input_send_mouse_event(input, flags, ev->x, ev->y);
}
@ -145,5 +155,5 @@ BOOL wlf_keyboard_enter(freerdp* instance, UwacKeyboardEnterLeaveEvent* ev)
input = instance->input;
return freerdp_input_send_focus_in_event(input, 0) &&
freerdp_input_send_mouse_event(input, PTR_FLAGS_MOVE, 0, 0);
freerdp_input_send_mouse_event(input, PTR_FLAGS_MOVE, 0, 0);
}