Changeset View
Changeset View
Standalone View
Standalone View
libinput/events.cpp
Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Line(s) | |||||
209 | } | 209 | } | ||
210 | 210 | | |||
211 | qreal PointerEvent::axisValue(InputRedirection::PointerAxis axis) const | 211 | qreal PointerEvent::axisValue(InputRedirection::PointerAxis axis) const | ||
212 | { | 212 | { | ||
213 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | 213 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | ||
214 | const libinput_pointer_axis a = axis == InputRedirection::PointerAxisHorizontal | 214 | const libinput_pointer_axis a = axis == InputRedirection::PointerAxisHorizontal | ||
215 | ? LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL | 215 | ? LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL | ||
216 | : LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; | 216 | : LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; | ||
217 | return libinput_event_pointer_get_axis_value(m_pointerEvent, a); | 217 | return libinput_event_pointer_get_axis_value(m_pointerEvent, a) * device()->scrollFactor(); | ||
davidedmundson: Why not this one? | |||||
218 | } | 218 | } | ||
219 | 219 | | |||
220 | qint32 PointerEvent::discreteAxisValue(InputRedirection::PointerAxis axis) const | 220 | qint32 PointerEvent::discreteAxisValue(InputRedirection::PointerAxis axis) const | ||
221 | { | 221 | { | ||
222 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | 222 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | ||
223 | const libinput_pointer_axis a = (axis == InputRedirection::PointerAxisHorizontal) | 223 | const libinput_pointer_axis a = (axis == InputRedirection::PointerAxisHorizontal) | ||
224 | ? LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL | 224 | ? LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL | ||
225 | : LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; | 225 | : LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; | ||
226 | return libinput_event_pointer_get_axis_value_discrete(m_pointerEvent, a); | 226 | return libinput_event_pointer_get_axis_value_discrete(m_pointerEvent, a) * device()->scrollFactor(); | ||
227 | } | 227 | } | ||
228 | 228 | | |||
229 | InputRedirection::PointerAxisSource PointerEvent::axisSource() const | 229 | InputRedirection::PointerAxisSource PointerEvent::axisSource() const | ||
230 | { | 230 | { | ||
231 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | 231 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | ||
232 | switch (libinput_event_pointer_get_axis_source(m_pointerEvent)) { | 232 | switch (libinput_event_pointer_get_axis_source(m_pointerEvent)) { | ||
233 | case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL: | 233 | case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL: | ||
234 | return InputRedirection::PointerAxisSourceWheel; | 234 | return InputRedirection::PointerAxisSourceWheel; | ||
▲ Show 20 Lines • Show All 163 Lines • Show Last 20 Lines |
Why not this one?