|
@@ -1353,6 +1353,7 @@ enum ImGuiSortDirection_
|
|
// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87).
|
|
// All our named keys are >= 512. Keys value 0 to 511 are left unused as legacy native/opaque key values (< 1.87).
|
|
// Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey.
|
|
// Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey.
|
|
// Read details about the 1.87 and 1.89 transition : https://github.com/ocornut/imgui/issues/4921
|
|
// Read details about the 1.87 and 1.89 transition : https://github.com/ocornut/imgui/issues/4921
|
|
|
|
+// Note that "Keys" related to physical keys and are not the same concept as input "Characters", the later are submitted via io.AddInputCharacter().
|
|
enum ImGuiKey : int
|
|
enum ImGuiKey : int
|
|
{
|
|
{
|
|
// Keyboard
|
|
// Keyboard
|
|
@@ -1460,15 +1461,16 @@ enum ImGuiKey : int
|
|
|
|
|
|
// [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array.
|
|
// [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array.
|
|
// We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE)
|
|
// We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE)
|
|
|
|
+ // If you need to iterate all keys (for e.g. an input mapper) you may use ImGuiKey_NamedKey_BEGIN..ImGuiKey_NamedKey_END.
|
|
ImGuiKey_NamedKey_BEGIN = 512,
|
|
ImGuiKey_NamedKey_BEGIN = 512,
|
|
ImGuiKey_NamedKey_END = ImGuiKey_COUNT,
|
|
ImGuiKey_NamedKey_END = ImGuiKey_COUNT,
|
|
ImGuiKey_NamedKey_COUNT = ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN,
|
|
ImGuiKey_NamedKey_COUNT = ImGuiKey_NamedKey_END - ImGuiKey_NamedKey_BEGIN,
|
|
#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
|
|
#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
|
|
- 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_SIZE = ImGuiKey_NamedKey_COUNT, // Size of KeysData[]: only hold named keys
|
|
|
|
+ ImGuiKey_KeysData_OFFSET = ImGuiKey_NamedKey_BEGIN, // Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index.
|
|
#else
|
|
#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_SIZE = ImGuiKey_COUNT, // Size of KeysData[]: hold legacy 0..512 keycodes + named keys
|
|
|
|
+ ImGuiKey_KeysData_OFFSET = 0, // Accesses to io.KeysData[] must use (key - ImGuiKey_KeysData_OFFSET) index.
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
|
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|