diff options
| author | epsilonshmepsilon <82274744+epsilonshmepsilon@users.noreply.github.com> | 2025-10-10 17:05:51 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-10 17:05:51 +0200 |
| commit | 6a01c399a971a57854fb4a99ce246534139beda4 (patch) | |
| tree | 4c63e3e4f2b7093bd308edb63e6d8cbc336baa13 /src/managers/input/InputManager.cpp | |
| parent | da31e82aabd1e2f5178aa303133db8132a0c298a (diff) | |
input: add option to rotate device input (#11947)
Diffstat (limited to 'src/managers/input/InputManager.cpp')
| -rw-r--r-- | src/managers/input/InputManager.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.cpp b/src/managers/input/InputManager.cpp index fa7efb6a..63e08154 100644 --- a/src/managers/input/InputManager.cpp +++ b/src/managers/input/InputManager.cpp @@ -1279,6 +1279,11 @@ void CInputManager::setPointerConfigs() { const auto LIBINPUTSENS = std::clamp(g_pConfigManager->getDeviceFloat(devname, "sensitivity", "input:sensitivity"), -1.f, 1.f); libinput_device_config_accel_set_speed(LIBINPUTDEV, LIBINPUTSENS); + if (libinput_device_config_rotation_is_available(LIBINPUTDEV)) { + const auto ROTATION = std::clamp(g_pConfigManager->getDeviceInt(devname, "rotation", "input:rotation"), 0, 359); + libinput_device_config_rotation_set_angle(LIBINPUTDEV, ROTATION); + } + m->m_flipX = g_pConfigManager->getDeviceInt(devname, "flip_x", "input:touchpad:flip_x") != 0; m->m_flipY = g_pConfigManager->getDeviceInt(devname, "flip_y", "input:touchpad:flip_y") != 0; |
