mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 20:45:58 +01:00
tablet: Add left_handed option for tablets (#5178)
* Add left_handed option for tablets * Update left_handed tablet option's fallback string
This commit is contained in:
parent
95ac8a34b1
commit
9ddf1b105e
2 changed files with 6 additions and 0 deletions
|
@ -476,6 +476,7 @@ CConfigManager::CConfigManager() {
|
||||||
m_pConfig->addConfigValue("input:tablet:region_position", Hyprlang::VEC2{0, 0});
|
m_pConfig->addConfigValue("input:tablet:region_position", Hyprlang::VEC2{0, 0});
|
||||||
m_pConfig->addConfigValue("input:tablet:region_size", Hyprlang::VEC2{0, 0});
|
m_pConfig->addConfigValue("input:tablet:region_size", Hyprlang::VEC2{0, 0});
|
||||||
m_pConfig->addConfigValue("input:tablet:relative_input", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("input:tablet:relative_input", Hyprlang::INT{0});
|
||||||
|
m_pConfig->addConfigValue("input:tablet:left_handed", Hyprlang::INT{0});
|
||||||
|
|
||||||
m_pConfig->addConfigValue("binds:pass_mouse_when_bound", Hyprlang::INT{0});
|
m_pConfig->addConfigValue("binds:pass_mouse_when_bound", Hyprlang::INT{0});
|
||||||
m_pConfig->addConfigValue("binds:scroll_event_delay", Hyprlang::INT{300});
|
m_pConfig->addConfigValue("binds:scroll_event_delay", Hyprlang::INT{300});
|
||||||
|
|
|
@ -1418,6 +1418,11 @@ void CInputManager::setTabletConfigs() {
|
||||||
Debug::log(LOG, "Setting calibration matrix for device {}", t.name);
|
Debug::log(LOG, "Setting calibration matrix for device {}", t.name);
|
||||||
libinput_device_config_calibration_set_matrix(LIBINPUTDEV, MATRICES[ROTATION]);
|
libinput_device_config_calibration_set_matrix(LIBINPUTDEV, MATRICES[ROTATION]);
|
||||||
|
|
||||||
|
if (g_pConfigManager->getDeviceInt(t.name, "left_handed", "input:tablet:left_handed") == 0)
|
||||||
|
libinput_device_config_left_handed_set(LIBINPUTDEV, 0);
|
||||||
|
else
|
||||||
|
libinput_device_config_left_handed_set(LIBINPUTDEV, 1);
|
||||||
|
|
||||||
const auto OUTPUT = g_pConfigManager->getDeviceString(t.name, "output", "input:tablet:output");
|
const auto OUTPUT = g_pConfigManager->getDeviceString(t.name, "output", "input:tablet:output");
|
||||||
const auto PMONITOR = g_pCompositor->getMonitorFromString(OUTPUT);
|
const auto PMONITOR = g_pCompositor->getMonitorFromString(OUTPUT);
|
||||||
if (!OUTPUT.empty() && OUTPUT != STRVAL_EMPTY && PMONITOR) {
|
if (!OUTPUT.empty() && OUTPUT != STRVAL_EMPTY && PMONITOR) {
|
||||||
|
|
Loading…
Reference in a new issue