Changeset View
Changeset View
Standalone View
Standalone View
input.cpp
Show First 20 Lines • Show All 685 Lines • ▼ Show 20 Line(s) | 672 | bool wheelEvent(QWheelEvent *event) override { | |||
---|---|---|---|---|---|
686 | return input()->shortcuts()->processAxis(event->modifiers(), direction); | 686 | return input()->shortcuts()->processAxis(event->modifiers(), direction); | ||
687 | } | 687 | } | ||
688 | bool keyEvent(QKeyEvent *event) override { | 688 | bool keyEvent(QKeyEvent *event) override { | ||
689 | if (event->type() == QEvent::KeyPress) { | 689 | if (event->type() == QEvent::KeyPress) { | ||
690 | return input()->shortcuts()->processKey(static_cast<KeyEvent*>(event)->modifiersRelevantForGlobalShortcuts(), event->nativeVirtualKey(), event->key()); | 690 | return input()->shortcuts()->processKey(static_cast<KeyEvent*>(event)->modifiersRelevantForGlobalShortcuts(), event->nativeVirtualKey(), event->key()); | ||
691 | } | 691 | } | ||
692 | return false; | 692 | return false; | ||
693 | } | 693 | } | ||
694 | bool swipeGestureBegin(int fingerCount, quint32 time) override { | ||||
695 | Q_UNUSED(time) | ||||
696 | input()->shortcuts()->processSwipeStart(fingerCount); | ||||
697 | return false; | ||||
698 | } | ||||
699 | bool swipeGestureUpdate(const QSizeF &delta, quint32 time) override { | ||||
700 | Q_UNUSED(time) | ||||
701 | input()->shortcuts()->processSwipeUpdate(delta); | ||||
702 | return false; | ||||
703 | } | ||||
704 | bool swipeGestureCancelled(quint32 time) override { | ||||
705 | Q_UNUSED(time) | ||||
706 | input()->shortcuts()->processSwipeCancel(); | ||||
707 | return false; | ||||
708 | } | ||||
709 | bool swipeGestureEnd(quint32 time) override { | ||||
710 | Q_UNUSED(time) | ||||
711 | input()->shortcuts()->processSwipeEnd(); | ||||
712 | return false; | ||||
713 | } | ||||
694 | }; | 714 | }; | ||
695 | 715 | | |||
696 | class InternalWindowEventFilter : public InputEventFilter { | 716 | class InternalWindowEventFilter : public InputEventFilter { | ||
697 | bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { | 717 | bool pointerEvent(QMouseEvent *event, quint32 nativeButton) override { | ||
698 | Q_UNUSED(nativeButton) | 718 | Q_UNUSED(nativeButton) | ||
699 | auto internal = input()->pointer()->internalWindow(); | 719 | auto internal = input()->pointer()->internalWindow(); | ||
700 | if (!internal) { | 720 | if (!internal) { | ||
701 | return false; | 721 | return false; | ||
▲ Show 20 Lines • Show All 1112 Lines • ▼ Show 20 Line(s) | 1833 | { | |||
1814 | m_shortcuts->registerPointerShortcut(action, modifiers, pointerButtons); | 1834 | m_shortcuts->registerPointerShortcut(action, modifiers, pointerButtons); | ||
1815 | } | 1835 | } | ||
1816 | 1836 | | |||
1817 | void InputRedirection::registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action) | 1837 | void InputRedirection::registerAxisShortcut(Qt::KeyboardModifiers modifiers, PointerAxisDirection axis, QAction *action) | ||
1818 | { | 1838 | { | ||
1819 | m_shortcuts->registerAxisShortcut(action, modifiers, axis); | 1839 | m_shortcuts->registerAxisShortcut(action, modifiers, axis); | ||
1820 | } | 1840 | } | ||
1821 | 1841 | | |||
1842 | void InputRedirection::registerTouchpadSwipeShortcut(SwipeDirection direction, QAction *action) | ||||
1843 | { | ||||
1844 | m_shortcuts->registerTouchpadSwipe(action, direction); | ||||
1845 | } | ||||
1846 | | ||||
1822 | void InputRedirection::registerGlobalAccel(KGlobalAccelInterface *interface) | 1847 | void InputRedirection::registerGlobalAccel(KGlobalAccelInterface *interface) | ||
1823 | { | 1848 | { | ||
1824 | m_shortcuts->setKGlobalAccelInterface(interface); | 1849 | m_shortcuts->setKGlobalAccelInterface(interface); | ||
1825 | } | 1850 | } | ||
1826 | 1851 | | |||
1827 | void InputRedirection::warpPointer(const QPointF &pos) | 1852 | void InputRedirection::warpPointer(const QPointF &pos) | ||
1828 | { | 1853 | { | ||
1829 | m_pointer->warp(pos); | 1854 | m_pointer->warp(pos); | ||
▲ Show 20 Lines • Show All 153 Lines • Show Last 20 Lines |