[Optional] Call after AddKeyEvent(). Specify native keycode, scancode + Specify index for legacy <1.87 IsKeyXXX() functions with native indices. If you are writing a backend in 2022 or don't use IsKeyXXX() with native values that are not ImGuiKey values, you can avoid calling this.
| 1426 | // Specify native keycode, scancode + Specify index for legacy <1.87 IsKeyXXX() functions with native indices. |
| 1427 | // If you are writing a backend in 2022 or don't use IsKeyXXX() with native values that are not ImGuiKey values, you can avoid calling this. |
| 1428 | void ImGuiIO::SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index) |
| 1429 | { |
| 1430 | if (key == ImGuiKey_None) |
| 1431 | return; |
| 1432 | IM_ASSERT(ImGui::IsNamedKey(key)); // >= 512 |
| 1433 | IM_ASSERT(native_legacy_index == -1 || ImGui::IsLegacyKey((ImGuiKey)native_legacy_index)); // >= 0 && <= 511 |
| 1434 | IM_UNUSED(native_keycode); // Yet unused |
| 1435 | IM_UNUSED(native_scancode); // Yet unused |
| 1436 | |
| 1437 | // Build native->imgui map so old user code can still call key functions with native 0..511 values. |
| 1438 | #ifndef IMGUI_DISABLE_OBSOLETE_KEYIO |
| 1439 | const int legacy_key = (native_legacy_index != -1) ? native_legacy_index : native_keycode; |
| 1440 | if (!ImGui::IsLegacyKey((ImGuiKey)legacy_key)) |
| 1441 | return; |
| 1442 | KeyMap[legacy_key] = key; |
| 1443 | KeyMap[key] = legacy_key; |
| 1444 | #else |
| 1445 | IM_UNUSED(key); |
| 1446 | IM_UNUSED(native_legacy_index); |
| 1447 | #endif |
| 1448 | } |
| 1449 | |
| 1450 | // Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen. |
| 1451 | void ImGuiIO::SetAppAcceptingEvents(bool accepting_events) |
no test coverage detected