Simpified code in GetKeyData() and used ImGuiKey_KeysData_OFFSET for consistency. Rework demo, Comments. Moved ImGuiKey_KeysData_OFFSET to internal.h (#4921, #6191)
ImGuiKey_KeysData_SIZE=ImGuiKey_NamedKey_COUNT,// Size of KeysData[]: only hold named keys
ImGuiKey_KeysData_OFFSET=ImGuiKey_NamedKey_BEGIN,// First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
ImGuiKey_KeysData_OFFSET=ImGuiKey_NamedKey_BEGIN,// Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index.
#else
ImGuiKey_KeysData_SIZE=ImGuiKey_COUNT,// Size of KeysData[]: hold legacy 0..512 keycodes + named keys
ImGuiKey_KeysData_OFFSET=0,// First key stored in io.KeysData[0]. Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET).
ImGuiKey_KeysData_OFFSET=0,// Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index.
structfuncs{staticboolIsLegacyNativeDupe(ImGuiKeykey){returnkey<512&&ImGui::GetIO().KeyMap[key]!=-1;}};// Hide Native<>ImGuiKey duplicates when both exists in the array
ImGui::Text("Chars queue:");for(inti=0;i<io.InputQueueCharacters.Size;i++){ImWcharc=io.InputQueueCharacters[i];ImGui::SameLine();ImGui::Text("\'%c\' (0x%04X)",(c>''&&c<=255)?(char)c:'?',c);}// FIXME: We should convert 'c' to UTF-8 here but the functions are not public.