SliderScalar does not respect g.IO.ConfigMacOSXBehaviors #4084

Closed
opened 2021-04-28 06:36:03 +00:00 by slajerek · 1 comment
slajerek commented 2021-04-28 06:36:03 +00:00 (Migrated from github.com)

Version/Branch of Dear ImGui:

Version: 1.82
Branch: master/docking

My Issue/Question:

SliderScalar does not respect g.IO.ConfigMacOSXBehaviors, thus to enter value one needs to do mouse click with CTRL key, but should be SUPER key. The fix is simple, needs to add check to ImGui::SliderScalar around line 2956 of imgui_widgets.cpp. For example like this:

bool ctrlKey = g.IO.ConfigMacOSXBehaviors ? g.IO.KeySuper : g.IO.KeyCtrl;
if (temp_input_allowed && (focus_requested || (clicked && ctrlKey) || g.NavInputId == id))

In overall it seems it would be better to wrap this into some generic behavior and globally define what is "CTRL" key.

Standalone, minimal, complete and verifiable example: just please use the imgui demo

**Version/Branch of Dear ImGui:** Version: 1.82 Branch: master/docking **My Issue/Question:** SliderScalar does not respect `g.IO.ConfigMacOSXBehaviors`, thus to enter value one needs to do mouse click with CTRL key, but should be SUPER key. The fix is simple, needs to add check to `ImGui::SliderScalar` around line 2956 of `imgui_widgets.cpp`. For example like this: ``` bool ctrlKey = g.IO.ConfigMacOSXBehaviors ? g.IO.KeySuper : g.IO.KeyCtrl; if (temp_input_allowed && (focus_requested || (clicked && ctrlKey) || g.NavInputId == id)) ``` In overall it seems it would be better to wrap this into some generic behavior and globally define what is "CTRL" key. **Standalone, minimal, complete and verifiable example:** just please use the imgui demo
ocornut commented 2022-06-20 16:42:18 +00:00 (Migrated from github.com)

Hello,

Sorry for my late answer on this.

In overall it seems it would be better to wrap this into some generic behavior and globally define what is "CTRL" key.

I think we'd first need to list one by one which behavior would want Super vs which would want CTRL. I imagine there are valid uses for CTRL on Mac.
Could you go through them mindfully to check what it most consistent with typical behavior?

  • Slider,Drag: CTRL+Click to turn into Input -> Use Super
  • When using keyboard nav, press space to tweak -> CTRL as a "Slow" modifier (vs Shift for "Fast") --> ???
  • CTRL+Tab to switch "sub" windows within a given parent window --> ???
  • Demo & Selection patterns: CTRL+Click to toggle an item selection state without clearing existing selection --> ???
  • When clicking on +/- buttons in an InputScalar() widget -> CTRL acts a Fast modifier (ouch we have an inconsistency with Nav inputs here, need fixing) --> ???
  • InputMultiline: Ctrl+Up/Down to scroll view without moving cursor --> ???

Thank you!

Hello, Sorry for my late answer on this. > In overall it seems it would be better to wrap this into some generic behavior and globally define what is "CTRL" key. I think we'd first need to list one by one which behavior would want Super vs which would want CTRL. I imagine there are valid uses for CTRL on Mac. Could you go through them mindfully to check what it most consistent with typical behavior? - Slider,Drag: CTRL+Click to turn into Input -> Use Super - When using keyboard nav, press space to tweak -> CTRL as a "Slow" modifier (vs Shift for "Fast") --> ??? - CTRL+Tab to switch "sub" windows within a given parent window --> ??? - Demo & Selection patterns: CTRL+Click to toggle an item selection state without clearing existing selection --> ??? - When clicking on +/- buttons in an InputScalar() widget -> CTRL acts a Fast modifier **(ouch we have an inconsistency with Nav inputs here, need fixing)** --> ??? - InputMultiline: Ctrl+Up/Down to scroll view without moving cursor --> ??? Thank you!
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#4084
No description provided.