KEMBAR78
GUI: Make text selectable in input boxes by hax0kartik · Pull Request #4753 · scummvm/scummvm · GitHub
Skip to content

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

Development

Successfully merging this pull request may close these issues.

2 participants