diff --git a/src/input.cpp b/src/input.cpp index cf798ecb15..f99df474c8 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -743,14 +743,14 @@ public: m_active = true; m_callback = callback; input()->keyboard()->update(); - input()->cancelTouch(); + input()->touch()->cancel(); } void start(std::function callback) { Q_ASSERT(!m_active); m_active = true; m_pointSelectionFallback = callback; input()->keyboard()->update(); - input()->cancelTouch(); + input()->touch()->cancel(); } private: void deactivate() { @@ -2723,71 +2723,6 @@ void InputRedirection::setupLibInputWithScreens() connect(screens(), &Screens::changed, m_libInput, &LibInput::Connection::updateScreens); } -void InputRedirection::processPointerMotion(const QPointF &pos, uint32_t time) -{ - m_pointer->processMotionAbsolute(pos, time); -} - -void InputRedirection::processPointerButton(uint32_t button, InputRedirection::PointerButtonState state, uint32_t time) -{ - m_pointer->processButton(button, state, time); -} - -void InputRedirection::processPointerAxis(InputRedirection::PointerAxis axis, qreal delta, qint32 discreteDelta, PointerAxisSource source, uint32_t time) -{ - m_pointer->processAxis(axis, delta, discreteDelta, source, time); -} - -void InputRedirection::processKeyboardKey(uint32_t key, InputRedirection::KeyboardKeyState state, uint32_t time) -{ - m_keyboard->processKey(key, state, time); -} - -void InputRedirection::processKeyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group) -{ - m_keyboard->processModifiers(modsDepressed, modsLatched, modsLocked, group); -} - -void InputRedirection::processKeymapChange(int fd, uint32_t size) -{ - m_keyboard->processKeymapChange(fd, size); -} - -void InputRedirection::processTouchDown(qint32 id, const QPointF &pos, quint32 time) -{ - m_touch->processDown(id, pos, time); -} - -void InputRedirection::processTouchUp(qint32 id, quint32 time) -{ - m_touch->processUp(id, time); -} - -void InputRedirection::processTouchMotion(qint32 id, const QPointF &pos, quint32 time) -{ - m_touch->processMotion(id, pos, time); -} - -void InputRedirection::cancelTouchSequence() -{ - m_touch->cancel(); -} - -void InputRedirection::cancelTouch() -{ - m_touch->cancel(); -} - -void InputRedirection::touchFrame() -{ - m_touch->frame(); -} - -int InputRedirection::touchPointCount() -{ - return m_touch->touchPointCount(); -} - Qt::MouseButtons InputRedirection::qtButtonStates() const { return m_pointer->buttons(); diff --git a/src/input.h b/src/input.h index 8859b449a1..0fc605dd56 100644 --- a/src/input.h +++ b/src/input.h @@ -142,42 +142,6 @@ public: void registerRealtimeTouchpadSwipeShortcut(SwipeDirection direction, QAction *onUp, std::function progressCallback); void registerGlobalAccel(KGlobalAccelInterface *interface); - /** - * @internal - */ - void processPointerMotion(const QPointF &pos, uint32_t time); - /** - * @internal - */ - void processPointerButton(uint32_t button, PointerButtonState state, uint32_t time); - /** - * @internal - */ - void processPointerAxis(PointerAxis axis, qreal delta, qint32 discreteDelta, PointerAxisSource source, uint32_t time); - /** - * @internal - */ - void processKeyboardKey(uint32_t key, KeyboardKeyState state, uint32_t time); - /** - * @internal - */ - void processKeyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group); - /** - * @internal - */ - void processKeymapChange(int fd, uint32_t size); - void processTouchDown(qint32 id, const QPointF &pos, quint32 time); - void processTouchUp(qint32 id, quint32 time); - void processTouchMotion(qint32 id, const QPointF &pos, quint32 time); - /** - * triggers the same code path as LIBINPUT_TOUCH_CANCEL_EVENT. - * Only intended for autotests - */ - void cancelTouchSequence(); - void cancelTouch(); - void touchFrame(); - int touchPointCount(); - bool supportsPointerWarping() const; void warpPointer(const QPointF &pos); diff --git a/src/platform.cpp b/src/platform.cpp index 48a6fc32da..e0695b35e8 100644 --- a/src/platform.cpp +++ b/src/platform.cpp @@ -13,6 +13,7 @@ #include "composite.h" #include "cursor.h" #include "effects.h" +#include "keyboard_input.h" #include #include "overlaywindow.h" #include "outline.h" @@ -20,6 +21,7 @@ #include "scene.h" #include "screens.h" #include "screenedge.h" +#include "touch_input.h" #include "wayland_server.h" #include @@ -259,7 +261,7 @@ void Platform::keyboardKeyPressed(quint32 key, quint32 time) if (!input()) { return; } - input()->processKeyboardKey(key, InputRedirection::KeyboardKeyPressed, time); + input()->keyboard()->processKey(key, InputRedirection::KeyboardKeyPressed, time); } void Platform::keyboardKeyReleased(quint32 key, quint32 time) @@ -267,7 +269,7 @@ void Platform::keyboardKeyReleased(quint32 key, quint32 time) if (!input()) { return; } - input()->processKeyboardKey(key, InputRedirection::KeyboardKeyReleased, time); + input()->keyboard()->processKey(key, InputRedirection::KeyboardKeyReleased, time); } void Platform::keyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, uint32_t modsLocked, uint32_t group) @@ -275,7 +277,7 @@ void Platform::keyboardModifiers(uint32_t modsDepressed, uint32_t modsLatched, u if (!input()) { return; } - input()->processKeyboardModifiers(modsDepressed, modsLatched, modsLocked, group); + input()->keyboard()->processModifiers(modsDepressed, modsLatched, modsLocked, group); } void Platform::keymapChange(int fd, uint32_t size) @@ -283,7 +285,7 @@ void Platform::keymapChange(int fd, uint32_t size) if (!input()) { return; } - input()->processKeymapChange(fd, size); + input()->keyboard()->processKeymapChange(fd, size); } void Platform::pointerAxisHorizontal(qreal delta, quint32 time, qint32 discreteDelta, InputRedirection::PointerAxisSource source) @@ -291,7 +293,7 @@ void Platform::pointerAxisHorizontal(qreal delta, quint32 time, qint32 discreteD if (!input()) { return; } - input()->processPointerAxis(InputRedirection::PointerAxisHorizontal, delta, discreteDelta, source, time); + input()->pointer()->processAxis(InputRedirection::PointerAxisHorizontal, delta, discreteDelta, source, time); } void Platform::pointerAxisVertical(qreal delta, quint32 time, qint32 discreteDelta, InputRedirection::PointerAxisSource source) @@ -299,7 +301,7 @@ void Platform::pointerAxisVertical(qreal delta, quint32 time, qint32 discreteDel if (!input()) { return; } - input()->processPointerAxis(InputRedirection::PointerAxisVertical, delta, discreteDelta, source, time); + input()->pointer()->processAxis(InputRedirection::PointerAxisVertical, delta, discreteDelta, source, time); } void Platform::pointerButtonPressed(quint32 button, quint32 time) @@ -307,7 +309,7 @@ void Platform::pointerButtonPressed(quint32 button, quint32 time) if (!input()) { return; } - input()->processPointerButton(button, InputRedirection::PointerButtonPressed, time); + input()->pointer()->processButton(button, InputRedirection::PointerButtonPressed, time); } void Platform::pointerButtonReleased(quint32 button, quint32 time) @@ -315,7 +317,7 @@ void Platform::pointerButtonReleased(quint32 button, quint32 time) if (!input()) { return; } - input()->processPointerButton(button, InputRedirection::PointerButtonReleased, time); + input()->pointer()->processButton(button, InputRedirection::PointerButtonReleased, time); } int Platform::touchPointCount() @@ -323,7 +325,7 @@ int Platform::touchPointCount() if (!input()) { return 0; } - return input()->touchPointCount(); + return input()->touch()->touchPointCount(); } void Platform::pointerMotion(const QPointF &position, quint32 time) @@ -331,7 +333,7 @@ void Platform::pointerMotion(const QPointF &position, quint32 time) if (!input()) { return; } - input()->processPointerMotion(position, time); + input()->pointer()->processMotionAbsolute(position, time); } void Platform::cancelTouchSequence() @@ -339,7 +341,7 @@ void Platform::cancelTouchSequence() if (!input()) { return; } - input()->cancelTouchSequence(); + input()->touch()->cancel(); } void Platform::touchCancel() @@ -347,7 +349,7 @@ void Platform::touchCancel() if (!input()) { return; } - input()->cancelTouch(); + input()->touch()->cancel(); } void Platform::touchDown(qint32 id, const QPointF &pos, quint32 time) @@ -355,7 +357,7 @@ void Platform::touchDown(qint32 id, const QPointF &pos, quint32 time) if (!input()) { return; } - input()->processTouchDown(id, pos, time); + input()->touch()->processDown(id, pos, time); } void Platform::touchFrame() @@ -363,7 +365,7 @@ void Platform::touchFrame() if (!input()) { return; } - input()->touchFrame(); + input()->touch()->frame(); } void Platform::touchMotion(qint32 id, const QPointF &pos, quint32 time) @@ -371,7 +373,7 @@ void Platform::touchMotion(qint32 id, const QPointF &pos, quint32 time) if (!input()) { return; } - input()->processTouchMotion(id, pos, time); + input()->touch()->processMotion(id, pos, time); } void Platform::touchUp(qint32 id, quint32 time) @@ -379,7 +381,7 @@ void Platform::touchUp(qint32 id, quint32 time) if (!input()) { return; } - input()->processTouchUp(id, time); + input()->touch()->processUp(id, time); } void Platform::processSwipeGestureBegin(int fingerCount, quint32 time)