summaryrefslogtreecommitdiff
path: root/src/managers/input/InputManager.hpp
diff options
context:
space:
mode:
authorppenguin <hieronymusv@gmail.com>2023-01-15 20:38:58 +0100
committerGitHub <noreply@github.com>2023-01-15 20:38:58 +0100
commit040e99fd174e46614e9dc37a77bad67b930ac5e9 (patch)
tree690a1cfb82422d9ac9d0924c1e3d6b6baee39161 /src/managers/input/InputManager.hpp
parentb5b436e01ddb5d5200f55be3deed8f4fade0574c (diff)
Add tablets calibration matrix for dynamic rotation with 2-in1/tablet PC usage (#1319)
Diffstat (limited to 'src/managers/input/InputManager.hpp')
-rw-r--r--src/managers/input/InputManager.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/managers/input/InputManager.hpp b/src/managers/input/InputManager.hpp
index a520ce1c..8e4223eb 100644
--- a/src/managers/input/InputManager.hpp
+++ b/src/managers/input/InputManager.hpp
@@ -25,6 +25,26 @@ struct STouchData {
Vector2D touchSurfaceOrigin;
};
+// The third row is always 0 0 1 and is not expected by `libinput_device_config_calibration_set_matrix`
+static const float MATRICES[8][6] = {
+ {// normal
+ 1, 0, 0, 0, 1, 0},
+ {// rotation 90°
+ 0, -1, 1, 1, 0, 0},
+ {// rotation 180°
+ -1, 0, 1, 0, -1, 1},
+ {// rotation 270°
+ 0, 1, 0, -1, 0, 1},
+ {// flipped
+ -1, 0, 1, 0, 1, 0},
+ {// flipped + rotation 90°
+ 0, 1, 0, 1, 0, 0},
+ {// flipped + rotation 180°
+ 1, 0, 0, 0, -1, 1},
+ {// flipped + rotation 270°
+ 0, -1, 1, -1, 0, 1}
+};
+
class CKeybindManager;
class CInputManager {