Changeset View
Changeset View
Standalone View
Standalone View
libinput/events.cpp
Show First 20 Lines • Show All 199 Lines • ▼ Show 20 Line(s) | |||||
200 | { | 200 | { | ||
201 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | 201 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | ||
202 | const libinput_pointer_axis a = axis == InputRedirection::PointerAxisHorizontal | 202 | const libinput_pointer_axis a = axis == InputRedirection::PointerAxisHorizontal | ||
203 | ? LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL | 203 | ? LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL | ||
204 | : LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; | 204 | : LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; | ||
205 | return libinput_event_pointer_get_axis_value(m_pointerEvent, a); | 205 | return libinput_event_pointer_get_axis_value(m_pointerEvent, a); | ||
206 | } | 206 | } | ||
207 | 207 | | |||
208 | qint32 PointerEvent::discreteAxisValue(InputRedirection::PointerAxis axis) const | ||||
209 | { | ||||
210 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | ||||
211 | const libinput_pointer_axis a = (axis == InputRedirection::PointerAxisHorizontal) | ||||
212 | ? LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL | ||||
213 | : LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL; | ||||
214 | return libinput_event_pointer_get_axis_value_discrete(m_pointerEvent, a); | ||||
215 | } | ||||
216 | | ||||
217 | InputRedirection::PointerAxisSource PointerEvent::axisSource() const | ||||
218 | { | ||||
219 | Q_ASSERT(type() == LIBINPUT_EVENT_POINTER_AXIS); | ||||
220 | switch (libinput_event_pointer_get_axis_source(m_pointerEvent)) { | ||||
221 | case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL: | ||||
222 | return InputRedirection::PointerAxisSourceWheel; | ||||
223 | case LIBINPUT_POINTER_AXIS_SOURCE_FINGER: | ||||
224 | return InputRedirection::PointerAxisSourceFinger; | ||||
225 | case LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS: | ||||
226 | return InputRedirection::PointerAxisSourceContinuous; | ||||
227 | case LIBINPUT_POINTER_AXIS_SOURCE_WHEEL_TILT: | ||||
228 | return InputRedirection::PointerAxisSourceWheelTilt; | ||||
229 | default: | ||||
230 | return InputRedirection::PointerAxisSourceUnknown; | ||||
231 | } | ||||
232 | } | ||||
233 | | ||||
208 | TouchEvent::TouchEvent(libinput_event *event, libinput_event_type type) | 234 | TouchEvent::TouchEvent(libinput_event *event, libinput_event_type type) | ||
209 | : Event(event, type) | 235 | : Event(event, type) | ||
210 | , m_touchEvent(libinput_event_get_touch_event(event)) | 236 | , m_touchEvent(libinput_event_get_touch_event(event)) | ||
211 | { | 237 | { | ||
212 | } | 238 | } | ||
213 | 239 | | |||
214 | TouchEvent::~TouchEvent() = default; | 240 | TouchEvent::~TouchEvent() = default; | ||
215 | 241 | | |||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |