| 9262 | IM_STATIC_ASSERT(ImGuiKey_NamedKey_COUNT == IM_ARRAYSIZE(GKeyNames)); |
| 9263 | |
| 9264 | const char* ImGui::GetKeyName(ImGuiKey key) |
| 9265 | { |
| 9266 | if (key == ImGuiKey_None) |
| 9267 | return "None"; |
| 9268 | IM_ASSERT(IsNamedKeyOrMod(key) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend and user code."); |
| 9269 | if (key & ImGuiMod_Mask_) |
| 9270 | key = ConvertSingleModFlagToKey(key); |
| 9271 | if (!IsNamedKey(key)) |
| 9272 | return "Unknown"; |
| 9273 | |
| 9274 | return GKeyNames[key - ImGuiKey_NamedKey_BEGIN]; |
| 9275 | } |
| 9276 | |
| 9277 | // Return untranslated names: on macOS, Cmd key will show as Ctrl, Ctrl key will show as super. |
| 9278 | // Lifetime of return value: valid until next call to same function. |
nothing calls this directly
no test coverage detected