MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / inputDescriptorToJson

Function inputDescriptorToJson

source/windowing/StarKeyBindings.cpp:123–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123Json inputDescriptorToJson(KeyChord const& chord) {
124 JsonArray modNames;
125 for (auto const& p : KeyModNames) {
126 if ((chord.mods & p.first) != KeyMod::NoMod)
127 modNames.append(p.second);
128 }
129 return JsonObject{
130 {"type", "key"},
131 {"value", KeyNames.getRight(chord.key)},
132 {"mods", modNames}
133 };
134}
135
136String printInputDescriptor(KeyChord chord) {
137 StringList modNames;

Callers 1

setKeybindingMethod · 0.85

Calls 1

appendMethod · 0.45

Tested by

no test coverage detected