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

GUI: Make text selectable in input boxes #4753

Merged
merged 3 commits into from Mar 1, 2023
Merged

Conversation

hax0kartik
Copy link
Contributor

This adds the ability to select text in a EditTextWidget.
The following list of behaviour is implemented:-

  • Double Click: Selects all the text
  • SHIFT + L/R: Increments/Decrements selection.
  • SHIFT + Left Click: Selects text between caret position and the mouse click.
  • SHIFT + Home/End : Selects Text between the caretPosition and starting of the string/the end of the string.
  • Dragging the mouse over the string will select that part of the string.
  • Pressing backspace while a selection has been made will delete that selection.
  • Pressing CTRL+C while a selection has been made will copy the selection to clipboard.
  • Pressing CTRL+V while a selection has been made will replace the selected text with the text from clipboard.

Many thanks to @sev- for answering my questions and writing the rendering code!

This code has been written by @sev-
TODOs:
    1. Investigate and fix characters jumping/shaking during selection.
    2. Make code compatible with RTL languages such as hebrew.
@hax0kartik hax0kartik changed the title WIDGET: Make Text Selectable GUI: Make text selectable in input boxes Mar 1, 2023
@sev-
Copy link
Member

sev- commented Mar 1, 2023

Thank you!

@sev- sev- merged commit e101f53 into scummvm:master Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants