|
@@ -1289,11 +1289,11 @@ struct ImGuiKeyOwnerData
|
|
ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_None; LockThisFrame = LockUntilRelease = false; }
|
|
ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_None; LockThisFrame = LockUntilRelease = false; }
|
|
};
|
|
};
|
|
|
|
|
|
-// Flags for extended versions of IsKeyPressed(), IsMouseClicked(), SetKeyOwner(), SetItemKeyOwner()
|
|
|
|
|
|
+// Flags for extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner()
|
|
// Don't mistake with ImGuiInputTextFlags! (for ImGui::InputText() function)
|
|
// Don't mistake with ImGuiInputTextFlags! (for ImGui::InputText() function)
|
|
enum ImGuiInputFlags_
|
|
enum ImGuiInputFlags_
|
|
{
|
|
{
|
|
- // Flags for IsKeyPressed(), IsMouseClicked()
|
|
|
|
|
|
+ // Flags for IsKeyPressed(), IsMouseClicked(), Shortcut()
|
|
ImGuiInputFlags_None = 0,
|
|
ImGuiInputFlags_None = 0,
|
|
ImGuiInputFlags_Repeat = 1 << 0, // Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1.
|
|
ImGuiInputFlags_Repeat = 1 << 0, // Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1.
|
|
ImGuiInputFlags_RepeatRateDefault = 1 << 1, // Repeat rate: Regular (default)
|
|
ImGuiInputFlags_RepeatRateDefault = 1 << 1, // Repeat rate: Regular (default)
|
|
@@ -2817,6 +2817,13 @@ namespace ImGui
|
|
IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0);
|
|
IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0);
|
|
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
|
|
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
|
|
|
|
|
|
|
|
+ // [EXPERIMENTAL] Shortcuts
|
|
|
|
+ // - ImGuiKeyChord = any ImGuiKey optionally ORed with ImGuiMod_XXX values.
|
|
|
|
+ // ImGuiKey_C (accepted by functions taking ImGuiKey or ImGuiKeyChord)
|
|
|
|
+ // ImGuiKey_C | ImGuiMod_Ctrl (accepted by functions taking ImGuiKeyChord)
|
|
|
|
+ // - ONLY ImGuiMod_XXX values are legal to 'OR' with an ImGuiKey. You CANNOT 'OR' two ImGuiKey values.
|
|
|
|
+ IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
|
|
|
|
+
|
|
// [EXPERIMENTAL] Focus Scope
|
|
// [EXPERIMENTAL] Focus Scope
|
|
// This is generally used to identify a unique input location (for e.g. a selection set)
|
|
// This is generally used to identify a unique input location (for e.g. a selection set)
|
|
// There is one per window (automatically set in Begin), but:
|
|
// There is one per window (automatically set in Begin), but:
|