Skip to content

Commit 83a0030

Browse files
committed
Added ImGuiMod_Shortcut which is ImGuiMod_Super on Mac and ImGuiMod_Ctrl otherwise. (ocornut#456)
1 parent fd408c9 commit 83a0030

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/CHANGELOG.txt

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

imgui.h

+5
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,11 @@ enum ImGuiKey : int
14591459
ImGuiMod_Alt = 1 << 14, // Option/Menu
14601460
ImGuiMod_Super = 1 << 15, // Cmd/Super/Windows
14611461
ImGuiMod_Mask_ = 0xF000,
1462+
#if defined(__APPLE__)
1463+
ImGuiMod_Shortcut = ImGuiMod_Super,
1464+
#else
1465+
ImGuiMod_Shortcut = ImGuiMod_Ctrl,
1466+
#endif
14621467

14631468
// [Internal] Prior to 1.87 we required user to fill io.KeysDown[512] using their own native index + the io.KeyMap[] array.
14641469
// We are ditching this method but keeping a legacy path for user code doing e.g. IsKeyPressed(MY_NATIVE_KEY_CODE)

0 commit comments

Comments
 (0)