From 040e99fd174e46614e9dc37a77bad67b930ac5e9 Mon Sep 17 00:00:00 2001 From: ppenguin Date: Sun, 15 Jan 2023 20:38:58 +0100 Subject: Add tablets calibration matrix for dynamic rotation with 2-in1/tablet PC usage (#1319) --- src/managers/input/InputManager.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/managers/input/InputManager.hpp') 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 { -- cgit v1.2.3