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

avm2: Add support for focus-related events #16581

Merged
merged 17 commits into from
Jul 25, 2024

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Jun 3, 2024

Related to #5443, progresses #17084, fixes (probably) #17064, progresses (probably) #14993.

This PR adds support for focusing objects on mouse click, and for dispatching focus-related events:

  • focusOut,
  • mouseFocusChange, and
  • keyFocusChange.

Behavior of those events and focusing objects by mouse is covered by tests:

  • avm2/focus_events_mouse_basic,
  • avm2/focus_events_key_same_object,
  • avm2/focus_events_key_basic,
  • avm2/focus_events_code,
  • avm2/focusrect_focuslost,
  • avm1/focus_mouse_focusable.

@kjarosh kjarosh changed the title avm2: Add support for events related to tab ordering avm2: Add support for events related to focus & tab ordering Jun 4, 2024
@danielhjacobs danielhjacobs added A-avm2 Area: AVM2 (ActionScript 3) waiting-on-author Waiting on the PR author to make the requested changes labels Jun 5, 2024
@kjarosh kjarosh force-pushed the tab-ordering-avm2-events branch 4 times, most recently from e22f177 to 8efdf83 Compare July 13, 2024 09:14
@kjarosh kjarosh force-pushed the tab-ordering-avm2-events branch 3 times, most recently from 3631050 to 7351646 Compare July 15, 2024 12:06
@kjarosh kjarosh changed the title avm2: Add support for events related to focus & tab ordering avm2: Add support for focus-related events Jul 15, 2024
@kjarosh kjarosh force-pushed the tab-ordering-avm2-events branch 2 times, most recently from 68d101d to a804f5f Compare July 15, 2024 14:15
@kjarosh kjarosh marked this pull request as ready for review July 15, 2024 14:21
@kjarosh kjarosh added waiting-on-review Waiting on review from a Ruffle team member and removed waiting-on-author Waiting on the PR author to make the requested changes labels Jul 15, 2024
@kjarosh kjarosh force-pushed the tab-ordering-avm2-events branch 2 times, most recently from 51de953 to cb2a3a8 Compare July 22, 2024 11:25
Copy link
Contributor

@Dinnerbone Dinnerbone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

This method allows constructing FocusEvents.
When clicking a focusable by mouse object in AVM2,
the focus should be updated.
The order of events seen during testing suggests that the focus
is updated before dispatching any mouse-related events.
This test checks which objects are focusable by mouse in AVM1.
This test verifies the behavior of focus-related events when
the window focus is lost.
This test verifies the behavior of focus-related events when
changing focus programmatically.
This test verifies the behavior of focus-related events when
changing focus using keyboard.
This test verifies the behavior of focus-related events when
changing focus to the same object using keyboard.
This test verifies the behavior of focus-related events
when using keyboard navigation.
This test verifies the behavior of focus-related events when
changing focus using mouse.
This test verifies the behavior of focus-related events when
changing focus to the same object using mouse.
This test verifies the behavior of focus-related events when
changing focus using keyboard and mouse interchangeably.
This test verifies the behavior of focus-related events when
trying to focus various interactive objects using mouse.
@torokati44
Copy link
Member

torokati44 commented Jul 25, 2024

Given two approvals, and all review notes fixed, I guess this is good to go now...?

@kjarosh kjarosh merged commit 8bfb50f into ruffle-rs:master Jul 25, 2024
17 checks passed
@kjarosh kjarosh deleted the tab-ordering-avm2-events branch July 25, 2024 14:38
@GonzalezAtWork
Copy link

awesome work! thanks!

@kjarosh kjarosh removed the waiting-on-review Waiting on review from a Ruffle team member label Jul 26, 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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants