{
rdpInput* input;
UINT16 flags = 0;
- int direction;
- uint32_t step;
+ int32_t direction;
uint32_t x, y;
+ uint32_t i;
if (!instance || !ev || !instance->input)
return FALSE;
input = instance->input;
- direction = wl_fixed_to_int(ev->value);
+ direction = ev->value;
switch (ev->axis)
{
case WL_POINTER_AXIS_VERTICAL_SCROLL:
* positive: 0 ... 0xFF -> slow ... fast
* negative: 0 ... 0xFF -> fast ... slow
*/
- step = abs(direction);
- if (step > 0xFF)
- step = 0xFF;
-
- /* Negative rotation, so count down steps from top */
- if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
- step = 0xFF - step;
-
- flags |= step;
+ for (i = 0; i < abs(direction); i++)
+ {
+ const uint32_t cflags = flags | 0x78;
+ if (!freerdp_input_send_mouse_event(input, cflags, (UINT16)x, (UINT16)y))
+ return FALSE;
+ }
- return freerdp_input_send_mouse_event(input, flags, (UINT16)x, (UINT16)y);
+ return TRUE;
}
BOOL wlf_handle_key(freerdp* instance, const UwacKeyEvent* ev)
break;
case UWAC_EVENT_POINTER_AXIS:
+ break;
+
+ case UWAC_EVENT_POINTER_AXIS_DISCRETE:
if (!wlf_handle_pointer_axis(instance, &event.mouse_axis))
return FALSE;
UWAC_EVENT_CLIPBOARD_SELECT,
UWAC_EVENT_CLIPBOARD_OFFER,
UWAC_EVENT_OUTPUT_GEOMETRY,
+ UWAC_EVENT_POINTER_AXIS_DISCRETE
};
/** @brief window states */
int32_t discrete)
{
/*UwacSeat *seat = data;*/
+ UwacPointerAxisEvent* event;
+ UwacSeat* seat = data;
+ UwacWindow* window = seat->pointer_focus;
+
+ if (!window)
+ return;
+
+ event =
+ (UwacPointerAxisEvent*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_POINTER_AXIS_DISCRETE);
+ if (!event)
+ return;
+
+ event->seat = seat;
+ event->window = window;
+ event->x = seat->sx;
+ event->y = seat->sy;
+ event->axis = axis;
+ event->value = discrete;
}
static const struct wl_pointer_listener pointer_listener = {