/* Require at least three px scrolling to start */
if (dy <= -3.0 || dy >= 3.0) {
tp->scroll.state = SCROLL_STATE_SCROLLING;
- tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL);
+ tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
}
if (dx <= -3.0 || dx >= 3.0) {
tp->scroll.state = SCROLL_STATE_SCROLLING;
- tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL);
+ tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
}
if (tp->scroll.state == SCROLL_STATE_NONE)
t->is_pointer = false;
if (dy != 0.0 &&
- (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL))) {
+ (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))) {
pointer_notify_axis(&tp->device->base,
time,
- LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL,
+ LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
dy);
}
if (dx != 0.0 &&
- (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL))) {
+ (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL))) {
pointer_notify_axis(&tp->device->base,
time,
- LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL,
+ LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL,
dx);
}
}
return;
/* terminate scrolling with a zero scroll event */
- if (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL))
+ if (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))
pointer_notify_axis(&tp->device->base,
time,
- LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL,
+ LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
0);
- if (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL))
+ if (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL))
pointer_notify_axis(&tp->device->base,
time,
- LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL,
+ LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL,
0);
tp->scroll.state = SCROLL_STATE_NONE;
pointer_notify_axis(
base,
time,
- LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL,
+ LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
-1 * e->value * DEFAULT_AXIS_STEP_DISTANCE);
break;
case REL_HWHEEL:
pointer_notify_axis(
base,
time,
- LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL,
+ LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL,
e->value * DEFAULT_AXIS_STEP_DISTANCE);
break;
default:
* Axes on a device that are not x or y coordinates.
*/
enum libinput_pointer_axis {
- LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL = 0,
- LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL = 1
+ LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL = 0,
+ LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL = 1,
+
+
+ /** @deprecated Use @ref LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL instead */
+ LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL,
+ /** @deprecated Use @ref LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL instead */
+ LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL = LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL
};
/**
*
* Return the axis value of the given axis. The interpretation of the value
* is dependent on the axis. For the two scrolling axes
- * LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL and
- * LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL, the value of the event is in
+ * LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL and
+ * LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL, the value of the event is in
* relative scroll units, with the positive direction being down or right,
* respectively. The dimension of a scroll unit is equal to one unit of
* motion in the respective axis, where applicable (e.g. touchpad two-finger
ck_assert(ptrev != NULL);
ck_assert_int_eq(libinput_event_pointer_get_axis(ptrev),
which == REL_WHEEL ?
- LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL :
- LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL);
+ LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL :
+ LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
ck_assert_int_eq(libinput_event_pointer_get_axis_value(ptrev), expected);
libinput_event_destroy(event);
}
double val;
switch (axis) {
- case LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL:
+ case LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL:
ax = "vscroll";
break;
- case LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL:
+ case LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL:
ax = "hscroll";
break;
default: