mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-09-29 22:58:28 +00:00
input: Add options to set tablet's active area (#5199)
* Add options to set tablet's active area * Set tablet's active area in `setTabletConfigs` * Fix formatting for new variables in ConfigManager * Report tablet's physical size with hyprctl
This commit is contained in:
@@ -51,8 +51,14 @@ void CInputManager::newTabletTool(wlr_input_device* pDevice) {
|
||||
|
||||
if (PTAB->relativeInput)
|
||||
wlr_cursor_move(g_pCompositor->m_sWLRCursor, PTAB->wlrDevice, dx, dy);
|
||||
else
|
||||
else {
|
||||
// Calculate transformations if active area is set
|
||||
if (!PTAB->activeArea.empty()) {
|
||||
x = (x - PTAB->activeArea.x) / (PTAB->activeArea.w - PTAB->activeArea.x);
|
||||
y = (y - PTAB->activeArea.y) / (PTAB->activeArea.h - PTAB->activeArea.y);
|
||||
}
|
||||
wlr_cursor_warp_absolute(g_pCompositor->m_sWLRCursor, PTAB->wlrDevice, x, y);
|
||||
}
|
||||
|
||||
g_pInputManager->simulateMouseMovement();
|
||||
g_pInputManager->focusTablet(PTAB, EVENT->tool, true);
|
||||
|
Reference in New Issue
Block a user