Browse Source

Nav: Activation can also be performed with Keypad Enter. (#5606)

pull/7143/head
ocornut 11 months ago
parent
commit
f59b54c6f4
  1. 1
      docs/CHANGELOG.txt
  2. 4
      imgui.cpp

1
docs/CHANGELOG.txt

@ -61,6 +61,7 @@ Other changes:
speed asymetry when (incorrectly) attempting to scroll by non-integer amount. (#6677) speed asymetry when (incorrectly) attempting to scroll by non-integer amount. (#6677)
- Nav, IO: SetNextFrameWantCaptureKeyboard(false) calls are not overrided back to true when - Nav, IO: SetNextFrameWantCaptureKeyboard(false) calls are not overrided back to true when
navigation is enabled. SetNextFrameWantCaptureKeyboard() is always higher priority. (#6997) navigation is enabled. SetNextFrameWantCaptureKeyboard() is always higher priority. (#6997)
- Nav: Activation can also be performed with Keypad Enter. (#5606)
- Drag and Drop: Fixed drop target highlight on items temporarily pushing a widened clip rect - Drag and Drop: Fixed drop target highlight on items temporarily pushing a widened clip rect
(namely Selectables and Treenodes using SpanAllColumn flag) so the highlight properly covers (namely Selectables and Treenodes using SpanAllColumn flag) so the highlight properly covers
all columns. (#7049, #4281, #3272) all columns. (#7049, #4281, #3272)

4
imgui.cpp

@ -11652,8 +11652,8 @@ static void ImGui::NavUpdate()
{ {
const bool activate_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Space)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadActivate)); const bool activate_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Space)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadActivate));
const bool activate_pressed = activate_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Space, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadActivate, false))); const bool activate_pressed = activate_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Space, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadActivate, false)));
const bool input_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Enter)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadInput)); const bool input_down = (nav_keyboard_active && (IsKeyDown(ImGuiKey_Enter) || IsKeyDown(ImGuiKey_KeyPadEnter))) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadInput));
const bool input_pressed = input_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Enter, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadInput, false))); const bool input_pressed = input_down && ((nav_keyboard_active && (IsKeyPressed(ImGuiKey_Enter, false) || IsKeyPressed(ImGuiKey_KeyPadEnter, false))) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadInput, false)));
if (g.ActiveId == 0 && activate_pressed) if (g.ActiveId == 0 && activate_pressed)
{ {
g.NavActivateId = g.NavId; g.NavActivateId = g.NavId;

Loading…
Cancel
Save