diff options
| author | Cascade aka. Isoheptane <38118922+Isoheptane@users.noreply.github.com> | 2023-09-28 02:49:30 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-27 19:49:30 +0100 |
| commit | 6d7dc70f663891ef39dcfb8ba8e5ff643b4d9ed8 (patch) | |
| tree | fc7ec6c8dc545599ffabfc1df7ad9b734fc4a7ac /src/config/ConfigManager.cpp | |
| parent | ffacd2efd1ca7fdf364a519c9d8d8644da28412b (diff) | |
input: Add map to region options for tablets (#3425)
* Add region remap for tablets
* Fix code style
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -rw-r--r-- | src/config/ConfigManager.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 2eaee318..7556776e 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -222,6 +222,8 @@ void CConfigManager::setDefaultVars() { configValues["input:touchdevice:output"].strValue = STRVAL_EMPTY; configValues["input:tablet:transform"].intValue = 0; configValues["input:tablet:output"].strValue = STRVAL_EMPTY; + configValues["input:tablet:region_position"].vecValue = Vector2D(); + configValues["input:tablet:region_size"].vecValue = Vector2D(); configValues["binds:pass_mouse_when_bound"].intValue = 0; configValues["binds:scroll_event_delay"].intValue = 300; @@ -278,6 +280,8 @@ void CConfigManager::setDeviceDefaultVars(const std::string& dev) { cfgValues["transform"].intValue = 0; cfgValues["output"].strValue = STRVAL_EMPTY; cfgValues["enabled"].intValue = 1; // only for mice / touchpads + cfgValues["region_position"].vecValue = Vector2D(); // only for tablets + cfgValues["region_size"].vecValue = Vector2D(); // only for tablets } void CConfigManager::setDefaultAnimationVars() { @@ -1737,6 +1741,10 @@ float CConfigManager::getFloat(const std::string& v) { return getConfigValueSafe(v).floatValue; } +Vector2D CConfigManager::getVec(const std::string& v) { + return getConfigValueSafe(v).vecValue; +} + std::string CConfigManager::getString(const std::string& v) { auto VAL = getConfigValueSafe(v).strValue; @@ -1754,6 +1762,10 @@ float CConfigManager::getDeviceFloat(const std::string& dev, const std::string& return getConfigValueSafeDevice(dev, v, fallback).floatValue; } +Vector2D CConfigManager::getDeviceVec(const std::string& dev, const std::string& v, const std::string& fallback) { + return getConfigValueSafeDevice(dev, v, fallback).vecValue; +} + std::string CConfigManager::getDeviceString(const std::string& dev, const std::string& v, const std::string& fallback) { auto VAL = getConfigValueSafeDevice(dev, v, fallback).strValue; @@ -1771,6 +1783,10 @@ void CConfigManager::setFloat(const std::string& v, float val) { configValues[v].floatValue = val; } +void CConfigManager::setVec(const std::string& v, Vector2D val) { + configValues[v].vecValue = val; +} + void CConfigManager::setString(const std::string& v, const std::string& val) { configValues[v].strValue = val; } |
