ソースを参照

Shortcut(): fixed 8323a06 adding _Repeat to all Shortcut() calls.

ocornut 1 年間 前
コミット
d7c2a0e38f
1 ファイル変更1 行追加1 行削除
  1. 1 1
      imgui.cpp

+ 1 - 1
imgui.cpp

@@ -9432,7 +9432,7 @@ bool ImGui::Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags
 
     // Default repeat behavior for Shortcut()
     // So e.g. pressing Ctrl+W and releasing Ctrl while holding W will not trigger the W shortcut.
-    if ((flags & ImGuiInputFlags_RepeatUntilMask_) == 0)
+    if ((flags & ImGuiInputFlags_Repeat) != 0 && (flags & ImGuiInputFlags_RepeatUntilMask_) == 0)
         flags |= ImGuiInputFlags_RepeatUntilKeyModsChange;
 
     if (!IsKeyChordPressed(key_chord, owner_id, flags))