MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / SetKeyEventNativeData

Method SetKeyEventNativeData

engine/3rdparty/imgui/imgui.cpp:1318–1336  ·  view source on GitHub ↗

[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.

Source from the content-addressed store, hash-verified

1316// Specify native keycode, scancode + Specify index for legacy <1.87 IsKeyXXX() functions with native indices.
1317// 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.
1318void ImGuiIO::SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index)
1319{
1320 if (key == ImGuiKey_None)
1321 return;
1322 IM_ASSERT(ImGui::IsNamedKey(key)); // >= 512
1323 IM_ASSERT(native_legacy_index == -1 || ImGui::IsLegacyKey(native_legacy_index)); // >= 0 && <= 511
1324 IM_UNUSED(native_keycode); // Yet unused
1325 IM_UNUSED(native_scancode); // Yet unused
1326
1327 // Build native->imgui map so old user code can still call key functions with native 0..511 values.
1328#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
1329 const int legacy_key = (native_legacy_index != -1) ? native_legacy_index : native_keycode;
1330 if (ImGui::IsLegacyKey(legacy_key))
1331 KeyMap[legacy_key] = key;
1332#else
1333 IM_UNUSED(key);
1334 IM_UNUSED(native_legacy_index);
1335#endif
1336}
1337
1338void ImGuiIO::AddKeyModsEvent(ImGuiKeyModFlags modifiers)
1339{

Calls 2

IsNamedKeyFunction · 0.85
IsLegacyKeyFunction · 0.85

Tested by

no test coverage detected