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

missing common text box interactions #108

Closed
andrewrk opened this issue Aug 20, 2024 · 7 comments
Closed

missing common text box interactions #108

andrewrk opened this issue Aug 20, 2024 · 7 comments

Comments

@andrewrk
Copy link

  • ctrl+backspace to delete previous word, ctrl+delete to delete next word
  • ctrl+left to go back one word, ctrl+right to go forward one word
  • home to go to beginning of line, end to go to end of line
  • ctrl+home to go to beginning of all text, ctrl+end to go to end of all text
  • double click to select word at cursor
  • triple click to select line at cursor
  • ctrl+A to select all

I'm sure there are more I'm forgetting but those are pretty frequently used, part of a lot of people's muscle memory.

Some of these require Unicode data awareness to implement correctly.

@david-vanderson
Copy link
Owner

Thanks for the feedback! Yes you're right I'll get on implementing those.

I've been punting on Unicode support so far, so my plan for word-based stuff is just space delimited. Do you need more than that?

@andrewrk
Copy link
Author

Full disclosure, I don't have any current plans to use this project - I was just poking around on the web demo. Someday I'll be interested in an IMGUI for a digital audio workstation, but I haven't picked up that project in a long time.

@david-vanderson
Copy link
Owner

No problem, I appreciate the report regardless.

david-vanderson added a commit that referenced this issue Sep 13, 2024
To properly implement #108
the logic needed an upgrade.

TextLayout.Selection gained the Affinity enum.  When the cursor is
between 2 characters that are separated by the end of a line (not a
newline character), affinity says whether the cursor is at the end of
the previous line or at the beginning of the new line.

This allows 3-click line selection and home/end to operate on visual
lines rather than newline chars.  Also left-right in a textEntry can now
position the cursor at the end of a line that doesn't have a newline
character.
@david-vanderson
Copy link
Owner

These should all be working now, including double-click-drag and triple-click-drag. They work with the corresponding key bindings on mac, even in the web demo.

Is this working for you now?

@andrewrk
Copy link
Author

Nice, it's feeling a lot better! I did notice one more issue, if you select text in the middle starting from left to right and then press ctrl+right (or do the inverted version of this), the cursor is expected to go to the end of selection and become width 0 but instead it jumps to the end of the line.

@david-vanderson
Copy link
Owner

Well I'll be. Never knew that before, and can't find any documentation for it, but you are totally right. I've added that.

Anything else nobody ever told me?

@david-vanderson
Copy link
Owner

I believe this is fixed. Please reopen or open another if needed. Thank you!

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

No branches or pull requests

2 participants