Implemented horizontal mouse wheel for wayland.
@@ -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;
+
+ case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
+ flags |= PTR_FLAGS_HWHEEL;
+ break;
- if (direction < 0)
- flags |= 0x0078;
- else
- flags |= PTR_FLAGS_WHEEL_NEGATIVE | 0x0088;
+ 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);
}
