Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SliderScalar does not respect g.IO.ConfigMacOSXBehaviors #4084

Closed
slajerek opened this issue Apr 28, 2021 · 5 comments
Closed

SliderScalar does not respect g.IO.ConfigMacOSXBehaviors #4084

slajerek opened this issue Apr 28, 2021 · 5 comments

Comments

@slajerek
Copy link

slajerek commented Apr 28, 2021

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
Copy link
Owner

ocornut commented Jun 20, 2022

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!

@ocornut ocornut added this to the v1.91 milestone May 13, 2024
@ocornut
Copy link
Owner

ocornut commented May 13, 2024

Linking to #2343 i am going to try tackling both of those together soon.

@ocornut
Copy link
Owner

ocornut commented May 13, 2024

Filling in list above as I booted my shiny Mac:

  • Slider,Drag: CTRL+Click to turn into Input -> change to use CMD
  • When using keyboard nav, press space to tweak -> CTRL as a "Slow" modifier (vs Shift for "Fast") --> doesn't matter tbh, but changing to use Super would make sense
  • CTRL+Tab to switch "sub" windows within a given parent window --> Keep Ctrl+Tab (confirmed in osx)
  • Demo & Selection patterns: CTRL+Click to toggle an item selection state without clearing existing selection --> change to use CMD -> (and additionally Shift+Click seems to have same effect)
  • When clicking on +/- buttons in an InputScalar() widget -> CTRL acts a Fast modifier (ouch we have an inconsistency with Nav inputs here, need fixing) --> Use CMD either way (InputScalar doesn't have a step_slow value)
  • InputMultiline: Ctrl+Up/Down to scroll view without moving cursor --> already not supported as Ctrl+Up/Down is used by OS!.

@ocornut
Copy link
Owner

ocornut commented May 16, 2024

This is now fixed by 7747106, as well as all items listed above.

@ocornut ocornut closed this as completed May 16, 2024
@slajerek
Copy link
Author

Thanks, I see that I overlooked your comment from 2022 :-/ apologies. Yeah, in overall this is exactly what we need :) Thank you for this fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants