MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SaveKeycodes

Function SaveKeycodes

src/hotkeys.cpp:205–213  ·  view source on GitHub ↗

* Convert all keycodes attached to a hotkey to a single string. If multiple * keycodes are attached to the hotkey they are split by a comma. * @param hotkey The keycodes of this hotkey need to be converted to a string. * @return A string representation of all keycodes. */

Source from the content-addressed store, hash-verified

203 * @return A string representation of all keycodes.
204 */
205std::string SaveKeycodes(const Hotkey &hotkey)
206{
207 std::string str;
208 for (auto keycode : hotkey.keycodes) {
209 if (!str.empty()) str += ",";
210 str += KeycodeToString(keycode);
211 }
212 return str;
213}
214
215/**
216 * Create a new Hotkey object with a single default keycode.

Callers 1

SaveMethod · 0.85

Calls 2

KeycodeToStringFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected