Skip to content

[Spec] SemanticService - more APIs for screen reader accessibility #1719

@rachelkang

Description

@rachelkang

SemanticService - more APIs for screen reader accessibility

An all-new SemanticService interface will be introduced as a home for new APIs for screen reader accessibility. Unlike SemanticProperties which is home to exposed properties, SemanticService will be home to exposed methods. Initial APIs will include Announce and SetFocus.

API

interface ISemanticService

public interface ISemanticService
{
      /// <summary>
      /// Tell screen reader to read out the text specified
      /// </summary>
      /// <param name="text"></param>
      void Announce(string text);

      /// <summary>
      /// Force accessibility focus to specified element
      /// </summary>
      /// <param name="element"></param>
      void SetFocus(VisualElement element);
}

Methods

API Description
Announce Sets text to be announced by screen reader. More context here, courtesy of @IeuanWalker
SetFocus Forces accessibility focus to a specified element

Scenarios

See https://github.com/PureWeen/A11YTools/tree/announcements for sample implementation and usage.

Difficulty : medium

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions