Added ImGuiMod_Shortcut which is ImGuiMod_Super on Mac and ImGuiMod_Ctrl otherwise. (#456)

This commit is contained in:
ocornut 2022-09-26 10:33:44 +02:00
parent fd408c9790
commit 83a0030c0a
2 changed files with 6 additions and 0 deletions

View File

@ -124,6 +124,7 @@ Other Changes:
bar boundaries (bug in 1.88). (#5652). bar boundaries (bug in 1.88). (#5652).
- Tabs: Enforcing minimum size of 1.0f, fixed asserting on zero-tab widths. (#5572) - Tabs: Enforcing minimum size of 1.0f, fixed asserting on zero-tab widths. (#5572)
- Window: Fixed a potential crash when appending to a child window. (#5515, #3496, #4797) [@rokups] - Window: Fixed a potential crash when appending to a child window. (#5515, #3496, #4797) [@rokups]
- IO: Added ImGuiMod_Shortcut which is ImGuiMod_Super on Mac and ImGuiMod_Ctrl otherwise. (#456)
- IO: Added ImGuiKey_MouseXXX aliases for mouse buttons/wheel so all operations done on ImGuiKey - IO: Added ImGuiKey_MouseXXX aliases for mouse buttons/wheel so all operations done on ImGuiKey
can apply to mouse data as well. (#4921) can apply to mouse data as well. (#4921)
- Menus: Fixed incorrect sub-menu parent association when opening a menu by closing another. - Menus: Fixed incorrect sub-menu parent association when opening a menu by closing another.

View File

@ -1459,6 +1459,11 @@ enum ImGuiKey : int
ImGuiMod_Alt = 1 << 14, // Option/Menu ImGuiMod_Alt = 1 << 14, // Option/Menu
ImGuiMod_Super = 1 << 15, // Cmd/Super/Windows ImGuiMod_Super = 1 << 15, // Cmd/Super/Windows
ImGuiMod_Mask_ = 0xF000, ImGuiMod_Mask_ = 0xF000,
#if defined(__APPLE__)
ImGuiMod_Shortcut = ImGuiMod_Super,
#else
ImGuiMod_Shortcut = ImGuiMod_Ctrl,
#endif
// [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)