summaryrefslogtreecommitdiff
path: root/src/managers/input/Tablets.cpp
diff options
context:
space:
mode:
authorVaxry <vaxry@vaxry.net>2023-12-09 04:07:28 +0000
committerVaxry <vaxry@vaxry.net>2023-12-09 04:07:28 +0000
commitdd0714c22a7f588c1c80f83b45f66f034f83a884 (patch)
treebe7a8afa419ed8adb284276574b0fb6467f6a988 /src/managers/input/Tablets.cpp
parent11d1c50420cdeaa5426b837a6479455f47368f29 (diff)
input: add relative_input for tablets
closes #2639
Diffstat (limited to 'src/managers/input/Tablets.cpp')
-rw-r--r--src/managers/input/Tablets.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/managers/input/Tablets.cpp b/src/managers/input/Tablets.cpp
index e5968a5a..2c1681c1 100644
--- a/src/managers/input/Tablets.cpp
+++ b/src/managers/input/Tablets.cpp
@@ -43,9 +43,16 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
g_pInputManager->m_tmrLastCursorMovement.reset();
break;
default:
- double x = (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_X) ? EVENT->x : NAN;
- double y = (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_Y) ? EVENT->y : NAN;
- wlr_cursor_warp_absolute(g_pCompositor->m_sWLRCursor, PTAB->wlrDevice, x, y);
+ double x = (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_X) ? EVENT->x : NAN;
+ double dx = (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_X) ? EVENT->dx : NAN;
+ double y = (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_Y) ? EVENT->y : NAN;
+ double dy = (EVENT->updated_axes & WLR_TABLET_TOOL_AXIS_Y) ? EVENT->dy : NAN;
+
+ if (PTAB->relativeInput)
+ wlr_cursor_move(g_pCompositor->m_sWLRCursor, PTAB->wlrDevice, dx, dy);
+ else
+ wlr_cursor_warp_absolute(g_pCompositor->m_sWLRCursor, PTAB->wlrDevice, x, y);
+
g_pInputManager->refocus();
g_pInputManager->m_tmrLastCursorMovement.reset();
break;