ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
61.11k stars 10.3k forks source link

Ctrl+Backspace behavior in TextInput #7704

Closed reduf closed 3 months ago

reduf commented 4 months ago

Version/Branch of Dear ImGui:

Version v1.90.8, Branch: master

Back-ends:

--

Compiler, OS:

Windows 11 + MSVC 2022

Full config/build information:

No response

Details:

My Issue/Question:

Hey, I noticed that ctrl+backspace would erase a full path (e.g., C:\Users\John) without stopping at the \ or at the /. I tracked the reason to this function that doesn't include \ and / as seperator.

I tried to track down the original commit, but it's a bit hard, due to the function moving file, but for sure it's over 6 years old. What I was wondering, is whether there is a reason to not include those two characters as seperator?

As an example, Chrome, Firefox, Powershell, Explorer (probably most other software) treat \ and / as seperator for the sake of Ctrl+Backspace. Cmd.exe doesn't, I'm sure there is other, but won't try every software.

Screenshots/Video:

No response

Minimal, Complete and Verifiable Example code:

No response

ocornut commented 4 months ago

We could add this indeed.

It would be good to survey other features (ctrl + arrows etc) on both Windows and Mac and decide which would be affected by slashes and which would not.

reduf commented 4 months ago

I can definitely try to get some data on Windows, but I have no way to do it on Mac. I'll edit the original post with a list of "common" software, but anybody is free to participate.

Mattwmaster58 commented 4 months ago

It would be good to survey other features (ctrl + arrows etc)

Hmm, my assumption and intuition / data on windows would be these boundaries would be the same between different Ctrl actions (arrow, backspace, shift+arrow)

reduf commented 4 months ago

I'll actually create the list here, anybody feel free to contribute:

Windows

Consider / and \ as seperator for Ctrl+Backspace and for Ctrl+Arrows

Ignore / and \ as seperator for Ctrl+Backspace and for Ctrl+Arrows

ocornut commented 3 months ago

Thank you Laurent for the detailed list. Merged your change as 96460a8a. I apologize that I haven't reacted to this earlier. I'm happy with following Windows standard by default. If the question is ever raised again for other OS/apps we'll have this as a reference. Thanks!