Add input:touchdevice:td_rotation config

Add support for touch device roation. The rotation is
set globally with `input:touchdevice:td_rotation config` and by
device with `td_rotation` in a device block.
This commit is contained in:
Histausse
2022-10-07 16:03:52 +02:00
parent fe4a97f245
commit 32ae0c51f0
5 changed files with 59 additions and 0 deletions

View File

@@ -147,6 +147,7 @@ void CConfigManager::setDefaultVars() {
configValues["input:touchpad:tap-to-click"].intValue = 1;
configValues["input:touchpad:drag_lock"].intValue = 0;
configValues["input:touchpad:scroll_factor"].floatValue = 1.f;
configValues["input:touchdevice:td_rotation"].intValue = 0;
configValues["binds:pass_mouse_when_bound"].intValue = 0;
configValues["binds:scroll_event_delay"].intValue = 300;
@@ -187,6 +188,7 @@ void CConfigManager::setDeviceDefaultVars(const std::string& dev) {
cfgValues["drag_lock"].intValue = 0;
cfgValues["left_handed"].intValue = 0;
cfgValues["scroll_method"].strValue = STRVAL_EMPTY;
cfgValues["td_rotation"].intValue = 0;
}
void CConfigManager::setDefaultAnimationVars() {
@@ -1139,6 +1141,7 @@ void CConfigManager::loadConfigLoadVars() {
if (!isFirstLaunch) {
g_pInputManager->setKeyboardLayout();
g_pInputManager->setPointerConfigs();
g_pInputManager->setTouchDeviceConfigs();
}
// Calculate the internal vars
@@ -1424,6 +1427,7 @@ void CConfigManager::dispatchExecOnce() {
// set input, fixes some certain issues
g_pInputManager->setKeyboardLayout();
g_pInputManager->setPointerConfigs();
g_pInputManager->setTouchDeviceConfigs();
// set ws names again
for (auto& ws : g_pCompositor->m_vWorkspaces) {