Skip to content

Multi-press support#24264

Open
ickshonpe wants to merge 3 commits into
bevyengine:mainfrom
ickshonpe:multi-press-support
Open

Multi-press support#24264
ickshonpe wants to merge 3 commits into
bevyengine:mainfrom
ickshonpe:multi-press-support

Conversation

@ickshonpe
Copy link
Copy Markdown
Contributor

@ickshonpe ickshonpe commented May 12, 2026

Objective

The text input widget selects the word under the pointer on a double click. This isn't correct, the select word edit should be queued on the press following a click. This allows for users to select a word with a double press and then hold the button and drag to extend the selection.

Solution

Track multi-presses as well as multi-clicks:

  • Add a count field to Press events.
  • Update the click count in PointerButtonState::clicking on consecutive presses within the multi-click duration, not on releases.
  • Filter the clicking map in both the Press and Click dispatchers.

Testing

cargo run --example multiline_text_input

You should observe that dragging after selecting a word with a double press extends the selection.

It's still not quite right as the selection is extended from the point in the word that was clicked, not the word itself. This is a bug in Parley revealed by this change.

ickshonpe added 3 commits May 12, 2026 14:44
This is to allow click then press and drag actions.

Text inputs no long observe `Click` events, instead they check `count` on press.
@ickshonpe ickshonpe added C-Bug An unexpected or incorrect behavior A-UI Graphical user interfaces, styles, layouts, and widgets A-Text Rendering and layout for characters D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Picking Pointing at and selecting objects of all sorts labels May 12, 2026
@github-project-automation github-project-automation Bot moved this to Needs SME Triage in UI May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Picking Pointing at and selecting objects of all sorts A-Text Rendering and layout for characters A-UI Graphical user interfaces, styles, layouts, and widgets C-Bug An unexpected or incorrect behavior D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Needs-Review Needs reviewer attention (from anyone!) to move forward

Projects

Status: Needs SME Triage

Development

Successfully merging this pull request may close these issues.

1 participant