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

Ctrl+Backspace behavior in TextInput #7704

Closed
reduf opened this issue Jun 18, 2024 · 5 comments
Closed

Ctrl+Backspace behavior in TextInput #7704

reduf opened this issue Jun 18, 2024 · 5 comments

Comments

@reduf
Copy link
Contributor

reduf commented Jun 18, 2024

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

ocornut commented Jun 18, 2024

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
Copy link
Contributor Author

reduf commented Jun 18, 2024

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

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
Copy link
Contributor Author

reduf commented Jun 18, 2024

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

Windows

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

  • Firefox search bar
  • Chrome search bar
  • Powershell
  • Spotify search
  • File Explorer
  • Discord
  • Sublime Text
  • Visual Studio Code (Maybe default on Electron?)
  • p4merge (Maybe default with Qt?)
  • Open Broadcaster Studio
  • Notepad++

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

  • Cmd.exe

reduf added a commit to reduf/imgui that referenced this issue Jul 28, 2024
This means that ctrl+(left|right) arrows and ctrl+backspace will stop at
slashes, which is more inline with how most software works and generally
is very convenient when dealing with paths or urls.

Relevant issue: ocornut#7704
reduf added a commit to reduf/imgui that referenced this issue Jul 28, 2024
Adding those seperators means that ctrl+(left|right)-arrows and ctrl+backspace
will stop at slashes, which is more inline with how most software works and
generally is very convenient when dealing with paths or urls.

Relevant issue: ocornut#7704
ocornut pushed a commit that referenced this issue Jul 29, 2024
Adding those seperators means that ctrl+(left|right)-arrows and ctrl+backspace will stop at slashes, which is more inline with how most software works and generally is very convenient when dealing with paths or urls.
@ocornut
Copy link
Owner

ocornut commented Jul 29, 2024

Thank you Laurent for the detailed list. Merged your change as 96460a8.
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!

@ocornut ocornut closed this as completed Jul 29, 2024
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

3 participants