MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / GetKeyName

Method GetKeyName

extern/imgui/imgui.cpp:8606–8628  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8604IM_STATIC_ASSERT(ImGuiKey_NamedKey_COUNT == IM_ARRAYSIZE(GKeyNames));
8605
8606const char* ImGui::GetKeyName(ImGuiKey key)
8607{
8608#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
8609 IM_ASSERT((IsNamedKey(key) || key == ImGuiKey_None) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code.");
8610#else
8611 if (IsLegacyKey(key))
8612 {
8613 ImGuiIO& io = GetIO();
8614 if (io.KeyMap[key] == -1)
8615 return "N/A";
8616 IM_ASSERT(IsNamedKey((ImGuiKey)io.KeyMap[key]));
8617 key = (ImGuiKey)io.KeyMap[key];
8618 }
8619#endif
8620 if (key == ImGuiKey_None)
8621 return "None";
8622 if (key & ImGuiMod_Mask_)
8623 key = ConvertSingleModFlagToKey(key);
8624 if (!IsNamedKey(key))
8625 return "Unknown";
8626
8627 return GKeyNames[key - ImGuiKey_NamedKey_BEGIN];
8628}
8629
8630// ImGuiMod_Shortcut is translated to either Ctrl or Super.
8631void ImGui::GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size)

Callers

nothing calls this directly

Calls 3

IsNamedKeyFunction · 0.85
IsLegacyKeyFunction · 0.85

Tested by

no test coverage detected