| 8547 | } |
| 8548 | |
| 8549 | ImGuiKeyData* ImGui::GetKeyData(ImGuiKey key) |
| 8550 | { |
| 8551 | ImGuiContext& g = *GImGui; |
| 8552 | |
| 8553 | // Special storage location for mods |
| 8554 | if (key & ImGuiMod_Mask_) |
| 8555 | key = ConvertSingleModFlagToKey(key); |
| 8556 | |
| 8557 | int index; |
| 8558 | #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO |
| 8559 | IM_ASSERT(key >= ImGuiKey_LegacyNativeKey_BEGIN && key < ImGuiKey_NamedKey_END); |
| 8560 | if (IsLegacyKey(key)) |
| 8561 | index = (g.IO.KeyMap[key] != -1) ? g.IO.KeyMap[key] : key; // Remap native->imgui or imgui->native |
| 8562 | else |
| 8563 | index = key; |
| 8564 | #else |
| 8565 | IM_ASSERT(IsNamedKey(key) && "Support for user key indices was dropped in favor of ImGuiKey. Please update backend & user code."); |
| 8566 | index = key - ImGuiKey_NamedKey_BEGIN; |
| 8567 | #endif |
| 8568 | return &g.IO.KeysData[index]; |
| 8569 | } |
| 8570 | |
| 8571 | #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO |
| 8572 | ImGuiKey ImGui::GetKeyIndex(ImGuiKey key) |
nothing calls this directly
no test coverage detected