Skip to content

avm2: Improve double click detection #17033

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

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Jul 7, 2024

This PR simplifies code a bit by removing InteractiveObject.last_click and using the click index mechanism introduced in #16946. This unifies the behavior between double click events and double/triple click selection.

By switching to click index, this PR fixes an issue where clicking the same object twice in quick succession but at completely different coordinates constituted a double click. FP treats this as two separate clicks.

Testing FP on Linux suggests that double click delay is <300 ms, whereas the previous value in Ruffle was 1000 ms. I assume the same mechanism for double click detection is used here as in text selection (i.e. a system setting for double click delay is used on Windows, a low constant on Linux).

This PR effectively changes the double click delay to 500 ms (as it's the default now), but a TODO is already added to make it configurable in the future.

Additionally a test for double clicking is added.

@kjarosh kjarosh added A-avm2 Area: AVM2 (ActionScript 3) input Issues relating to user input in Flash content waiting-on-review Waiting on review from a Ruffle team member labels Jul 7, 2024
@kjarosh kjarosh force-pushed the double-click-index branch 3 times, most recently from e1c5b65 to ba6ea55 Compare July 12, 2024 19:00
@Dinnerbone Dinnerbone force-pushed the double-click-index branch from ba6ea55 to 3c32396 Compare July 15, 2024 19:38
@Dinnerbone Dinnerbone enabled auto-merge (rebase) July 15, 2024 19:38
@Dinnerbone Dinnerbone merged commit c62bd1c into ruffle-rs:master Jul 15, 2024
17 checks passed
@kjarosh kjarosh deleted the double-click-index branch July 15, 2024 19:59
@danielhjacobs danielhjacobs removed the waiting-on-review Waiting on review from a Ruffle team member label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm2 Area: AVM2 (ActionScript 3) input Issues relating to user input in Flash content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants