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

[NUI][AT-SPI] Set focus in OnAccessibilityActivated() #5386

Merged
merged 1 commit into from
Jul 12, 2023

Conversation

aswigon
Copy link
Contributor

@aswigon aswigon commented Jul 11, 2023

Description of Change

This aligns the behaviour of Components (derived from CustomView), and other controls, with that of BaseComponents (and other controls with ViewAccessibilityMode.Default, backed by the C++ accessibility implementation), which set the keyboard focus on activation. Please note that in the latter case, the implementation of View.OnAccessibilityActivated is unused, and the unrelated method (albeit bearing the same name) Control::OnAccessibilityActivated is called:

bool Control::OnAccessibilityActivated()
{
  if(Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
  {
    return OnKeyboardEnter();
  }
  return false;
}

So, in other words, this patch makes C# controls behave in a similar manner, i.e. set the keyboard focus on accessibility activation.

API Changes

  • ACR: None

This aligns the behaviour of Components (derived from CustomView), and other controls, with that
of BaseComponents (and other controls with ViewAccessibilityMode.Default, backed by the C++
accessibility implementation), which set the keyboard focus on activation. Please note that in the
latter case, the implementation of View.OnAccessibilityActivated is unused, and the unrelated method
(albeit bearing the same name) Toolkit::Control::OnAccessibilityActivated is called:

bool Control::OnAccessibilityActivated()
{
  if(Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self()))
  {
    return OnKeyboardEnter();
  }
  return false;
}

So, in other words, this patch makes C# controls behave in a similar manner, i.e. set the keyboard
focus on accessibility activation.
Copy link
Contributor

@loleksak loleksak left a comment

Choose a reason for hiding this comment

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

LGTM, now its consistent with other toolkits

Copy link
Contributor

@Seoyeon2Kim Seoyeon2Kim left a comment

Choose a reason for hiding this comment

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

I think it's Okay because the similar implementation is already applied to dali-toolkit one. :)

@dongsug-song dongsug-song merged commit 3acf674 into Samsung:DevelNUI Jul 12, 2023
3 checks passed
@aswigon aswigon deleted the aswigon-a11y-focus branch July 12, 2023 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants