summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2025-08-28 11:20:29 +0200
committerGitHub <noreply@github.com>2025-08-28 11:20:29 +0200
commit81bf4eccba449bfe2b6adfb51260108aec710d4f (patch)
tree215c5b536cbcf1df9888081aadd3de16eb4b3ebe /src/managers/input/InputManager.cpp
parent378e130f1426648d8d734049800128f9882805bf (diff)
input: Add fully configurable trackpad gestures (#11490)
Adds configurable trackpad gestures
Diffstat (limited to 'src/managers/input/InputManager.cpp')
-rw-r--r--src/managers/input/InputManager.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp
index dff97166..5224f940 100644
--- a/src/managers/input/InputManager.cpp
+++ b/src/managers/input/InputManager.cpp
@@ -12,6 +12,7 @@
#include "../../protocols/IdleInhibit.hpp"
#include "../../protocols/RelativePointer.hpp"
#include "../../protocols/PointerConstraints.hpp"
+#include "../../protocols/PointerGestures.hpp"
#include "../../protocols/IdleNotify.hpp"
#include "../../protocols/SessionLock.hpp"
#include "../../protocols/InputMethodV2.hpp"
@@ -41,6 +42,8 @@
#include "../../helpers/time/Time.hpp"
#include "../../helpers/MiscFunctions.hpp"
+#include "trackpad/TrackpadGestures.hpp"
+
#include <aquamarine/input/Input.hpp>
CInputManager::CInputManager() {
@@ -1946,3 +1949,51 @@ void CInputManager::recheckMouseWarpOnMouseInput() {
if (!m_lastInputMouse && *PWARPFORNONMOUSE)
g_pPointerManager->warpTo(m_lastMousePos);
}
+
+void CInputManager::onSwipeBegin(IPointer::SSwipeBeginEvent e) {
+ EMIT_HOOK_EVENT_CANCELLABLE("swipeBegin", e);
+
+ g_pTrackpadGestures->gestureBegin(e);
+
+ PROTO::pointerGestures->swipeBegin(e.timeMs, e.fingers);
+}
+
+void CInputManager::onSwipeUpdate(IPointer::SSwipeUpdateEvent e) {
+ EMIT_HOOK_EVENT_CANCELLABLE("swipeUpdate", e);
+
+ g_pTrackpadGestures->gestureUpdate(e);
+
+ PROTO::pointerGestures->swipeUpdate(e.timeMs, e.delta);
+}
+
+void CInputManager::onSwipeEnd(IPointer::SSwipeEndEvent e) {
+ EMIT_HOOK_EVENT_CANCELLABLE("swipeEnd", e);
+
+ g_pTrackpadGestures->gestureEnd(e);
+
+ PROTO::pointerGestures->swipeEnd(e.timeMs, e.cancelled);
+}
+
+void CInputManager::onPinchBegin(IPointer::SPinchBeginEvent e) {
+ EMIT_HOOK_EVENT_CANCELLABLE("pinchBegin", e);
+
+ g_pTrackpadGestures->gestureBegin(e);
+
+ PROTO::pointerGestures->pinchBegin(e.timeMs, e.fingers);
+}
+
+void CInputManager::onPinchUpdate(IPointer::SPinchUpdateEvent e) {
+ EMIT_HOOK_EVENT_CANCELLABLE("pinchUpdate", e);
+
+ g_pTrackpadGestures->gestureUpdate(e);
+
+ PROTO::pointerGestures->pinchUpdate(e.timeMs, e.delta, e.scale, e.rotation);
+}
+
+void CInputManager::onPinchEnd(IPointer::SPinchEndEvent e) {
+ EMIT_HOOK_EVENT_CANCELLABLE("pinchEnd", e);
+
+ g_pTrackpadGestures->gestureEnd(e);
+
+ PROTO::pointerGestures->pinchEnd(e.timeMs, e.cancelled);
+}