3DConnexion devices: added option to swap y/z translations

This commit is contained in:
Enrico Turri 2020-03-20 13:09:42 +01:00
parent 170650169c
commit f912fecad5
4 changed files with 30 additions and 11 deletions

View file

@ -280,7 +280,7 @@ void AppConfig::set_recent_projects(const std::vector<std::string>& recent_proje
}
}
void AppConfig::set_mouse_device(const std::string& name, double translation_speed, double translation_deadzone, float rotation_speed, float rotation_deadzone, double zoom_speed)
void AppConfig::set_mouse_device(const std::string& name, double translation_speed, double translation_deadzone, float rotation_speed, float rotation_deadzone, double zoom_speed, bool swap_yz_translations)
{
std::string key = std::string("mouse_device:") + name;
auto it = m_storage.find(key);
@ -293,6 +293,7 @@ void AppConfig::set_mouse_device(const std::string& name, double translation_spe
it->second["rotation_speed"] = std::to_string(rotation_speed);
it->second["rotation_deadzone"] = std::to_string(rotation_deadzone);
it->second["zoom_speed"] = std::to_string(zoom_speed);
it->second["swap_yz_translations"] = swap_yz_translations ? "1" : "0";
}
std::vector<std::string> AppConfig::get_mouse_device_names() const