Multi-press support#24264
Conversation
This is to allow click then press and drag actions. Text inputs no long observe `Click` events, instead they check `count` on press.
… if we update the click count on presses.
Pretty sure Parley's |
Yep you are right. It was the bug fixed by #24260 collapsing the selection before the drag with an extra |
|
It looks like your PR is a breaking change, but you didn't provide a migration guide. Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes. |
|
A great QoL improvement. Something I've noticed when testing: Clicking on one word and then quickly clicking on a different word will select that whole word. Multi-press counter should be restarted when the cursor moves beyond a few pixels delta. We could iterate though. |
Yeah I deliberately ignored distance in the click PR and this one because I didn't want to bother with it because there might be some annoying scaling problems. I guess though maybe thinking about it now, we could just keep the timing in the picking module and then compare the distance in the widget logic. Then we could even have an explicit check that both presses are on the same word. |
|
There's no need for a migration guide I think, there aren't any breaking changes. |
… the MULTI_CLICK_DURATION const. `pointer_events` now uses the duration from `PickingSettings` for multi-clicks.
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:
countfield toPressevents.PointerButtonState::clickingon consecutive presses within the multi-click duration, not on releases.clickingmap in both thePressandClickdispatchers.MULTI_CLICK_DURATIONconst.multi_click_durationfield on thePickingSettingsresource.Testing
You should observe that dragging after selecting a word with a double press extends the selection.