A list of all actions that can be executed on an object shall be programmatically determinable.

Rationale

The checkpoint requires that the list of executable actions offered by each software object be made available programmatically. This gives assistive technology (AT) access to all the supported actions without the user resorting to accessing them through a mechansim like a context menu, which would require extra steps. For example, a node in a flow diagram could be opened when the user presses Enter or Spacebar, deleted via the Delete key or copied via Ctrl+C. These 3 possible actions would be available to ATs. This is especially beneficial for ATs that offer assistance to users with mobility impairment, such as voice control software or on-screen keyboards.

Note: If the list of executable actions has more than one action, the first one should be identified as the default action. (Reference: IAccessibleAction Interface specifications and AccessibleAction reference page in Mozilla Developer's Network.)

Development Techniques

Note: Review the General techniques as well as other tabs applicable to your technology.  Prioritize the use of technology-specific techniques, and implement the General techniques as needed. You are always required to find, understand and implement accessible code techniques to meet the checkpoint. The documented techniques and supplements are not exhaustive; they illustrate acceptable ways to achieve the spirit of the checkpoint. If numbered, techniques are in order of preference, with recommended techniques listed first.

General techniques

Each item in this section represents a technique deemed sufficient.

  • Programmatically exposing all actions that can be executed on an object

Mobile Native (iOS) techniques

Instructions: In addition to the General techniques, the Mobile Native iOS techniques in this section represent a technique or combination of techniques deemed sufficient for meeting this checkpoint (502.3.10).

Programmatically exposing all actions that can be executed on an object

Add gesture-based actions

Programmatically exposing all actions that can be executed on an object

Using standard controls from the UIKit framework exposes actions automatically.  Additional actions can be described using Hints and Traits.  See also UIKit Interface Catalog.

Add gesture-based actions

When gestures are assigned to a screen component, use the accessibilityCustomActions method to add the gesture-based actions to the component.

Eclipse techniques

In addition to the General techniques, the Eclipse techniques in this section represent a combination of techniques deemed sufficient.

Implementing AccessibleActionListener for control

Add an AccessibleActionListener to the Accessible information of the control and implement the methods of AccessibleActionListener. This enables an assistive technology to obtain the number of available actions along with the name and description of each action.

If the control supports more than one action, the first action (index 0) is the "default" action of the object.

toolBar.getAccessible().addAccessibleActionListener(new AccessibleActionAdapter() {
    @Override
    public void getActionCount(AccessibleActionEvent e) {
        e.count = getActionCount();
    }
    
    @Override
    public void getName(AccessibleActionEvent e) {
        e.result = "Name of the action: " + getAction(e.index);
    }

    @Override
    public void getDescription(AccessibleActionEvent e) {
        e.result = "Description of the action: " + getAction(e.index);
    }

    @Override
    public void doAction(AccessibleActionEvent e) {
        executeAction(e.index);
        e.result = ACC.OK;
    }
});
 

Implementing AccessibleControlListener to return the default action.

Add an AccessibleControlListener to the Accessible information of the control and Implement getDefaultAction to return the provide information about the default action.

Note: When using simple SWT widgets, e.g., Button, the default action is already defined by the platform. This can be confirmed by examining the control with Inspect Objects.

toolBar.getAccessible().addAccessibleControlListener(new AccessibleControlAdapter() {
     public void getDefaultAction(AccessibleControlEvent e) {
        e.result = getAction(0);
     }
                
});
 

 

Windows-based (MSAA+IA2) techniques

Instructions: In addition to the General techniques, refer to the Windows techniques tab in checkpoint 502.3.1 Object Information to learn about accessibility APIs, and use the following to support Windows accessibilty.

Implementing IAccessibleAction

Every accessible object that can be manipulated via the native GUI beyond the methods available either in the MSAA IAccessible interface or in the set of IAccessible2 interfaces (other than this IAccessibleAction interface) should support the IAccessibleAction interface in order to provide Assistive Technology access to all the actions that can be performed by the object. (Source: IAccessibleAction Interface reference at linuxfoundation.org.)

  • Return the number of actions available in the object through the nActions method.
  • For objects that support more than one action, implement keyBinding method to return an array of one or more key bindings associated with each action.
  • Return the name and localized name for each action by implementing name and localizedName methods.
  • Return the description for each action through the description method.

Even if the object only supports a single action, it is still important to implement IAccessibleAction while the Microsoft Active Accessibility (MSAA) IAccessible interface provides access only to the default action without the user knowing exactly what the default action does.

Implementing get_accDefaultAction  and get_accKeyboardShortcut

It is important to continue to support the MSAA IAccessible interface for ATs that require it. Implement the get_accDefaultAction  method of IAccessible to programmatically expose the default action of the control to assistive technology (AT).

For all objects that have a shortcut key or an access key, implement the IAccessible::get_accKeyboardShortcut method to programmatically expose the specified object's shortcut key or access key, also known as the mnemonic.


Most links in this checklist reside outside ibm.com at the Web Content Accessibility Guidelines (WCAG) 2.0. W3C Recommendation 11 December 2008: http://www.w3.org/TR/WCAG20/

Copyright © 1994-2017 World Wide Web Consortium, (Massachusetts Institute of Technology, European Research Consortium for Informatics and Mathematics, Keio University, Beihang University). All Rights Reserved.

Copyright © 2001, 2017 IBM Corporation