MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / save

Function save

Tactility/Source/settings/TrackballSettings.cpp:77–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77bool save(const TrackballSettings& settings) {
78 std::map<std::string, std::string> map;
79 map[KEY_TRACKBALL_ENABLED] = settings.trackballEnabled ? "1" : "0";
80 map[KEY_TRACKBALL_MODE] = (settings.trackballMode == TrackballMode::Pointer) ? "1" : "0";
81 map[KEY_ENCODER_SENSITIVITY] = std::to_string(std::clamp(settings.encoderSensitivity, MIN_ENCODER_SENSITIVITY, MAX_ENCODER_SENSITIVITY));
82 map[KEY_POINTER_SENSITIVITY] = std::to_string(std::clamp(settings.pointerSensitivity, MIN_POINTER_SENSITIVITY, MAX_POINTER_SENSITIVITY));
83 return file::savePropertiesFile(SETTINGS_FILE, map);
84}
85
86}

Callers

nothing calls this directly

Calls 2

clampFunction · 0.85
savePropertiesFileFunction · 0.85

Tested by

no test coverage detected