This is the first installment of the series and the easiest one too
Our today’s goal is to make our sample application accessible when only keyboard is available as input device. It will ease the users with vision or motor disabilities.
There are several ways to implement effective keyboard navigation in your desktop application like
- Shortcut Keys
- Access Keys
Tab Key is the primary mechanism for navigating within a window. Tabbing must be logical and consistent with language in which UI is written. Tab Key moves input focus to the next control in tab order, whereas SHIFT+TAB moves input focus to the previous control
In order to set tab order of controls and to receive input focus, TabStop property of control must be true while sequence or order of receiving focus can be set by TabIndex property.
As shown in the Figure1, navigation is from left to right. If your UI is written in right to left language then order would be accordingly.
Points to Remember:
- Use Tab to move input focus from one UI element to another
- Use SHIFT+TAB to traverse back.
Tab Key should move from Left to Right.
ii. Shortcut Keys
Keyboard users can use key or combination of keys to access frequently performed actions quickly by using the keyboard. As shown below CTRL+F will execute find command. While choosing shortcut keys assign simple and consistent key combination and prefer CTRL+ letter or Fn keys.
Points to Remember:
As the shortcut keys are memorized by frequent users, try to follow the standards when assigning shortcut keys. Follow these guidelines for selecting shortcut keys:
- Use SHIFT+key combination to complement or extend action of standard key. For instance ALT+TAB displays the primary window of running application, where as SHIFT+ALT+TAB allow you to navigate backward.
- All shortcut key used by the application should be properly documented in tooltips, menus and Help,as shown in below image.
- Assign shortcut key to most frequently used features by end users. Infrequently used features do not need shortcut keys as user can access them through access key.
- Do not assign non-standard functionality to standard shortcuts such as Ctrl+C, Ctrl+X or Ctrl+A.
- Do not use
- ALT+letter, as they may conflict with access key.
- CTRL+ALT combinations because in some language versions system interpret it as an ALTGR key, which generates alphanumeric characters.
- Windows log key as modifier key for non-system level functions.
- Shortcut keys which are reserved by system or commonly used by other applications.
Shortcut key for Paste is Ctrl+V while Access key is P
iii. Access Keys
Keyboard users have also alternative to access UI element without using tab key i.e. Access Keys. Access Keys are alphanumeric keys used in conjunction with ALT key for accessibility to interact with all menu items or controls.
- It is assigned by placing an ampersand ‘&’, in the text of the control, before the letter, which would be the access key.
Setting access key and shortcut key in properties window
- Buttons labeled OK, Cancel, and Close aren’t assigned access keys because they are invoked with Enter and Esc keys. However assign access key to a control that performs OK/Cancel functionality but conjure up with different label.
- Windows indicates access keys by underlining the access key assignment and documented only in tooltips or texts, therefore selection of access key must be done with conscientious so that user can easily find the access key in control ‘s text.
Points to Remember
- Prefer first or second letter of the word, as it would be easy to discover.
- Use letter with wide width like those which are more than one pixel wide.
- Select distinct consonant or a vowel.
- Access must unique within the same menu level.
- Assign access keys to all menus and most controls.
- If there are some command that are common in most application then try to use the standard one like use B for Back and N for Next in wizard Pages. Similarly ‘A ‘ for apply command.
- For dynamic menus use access key numerically .e.g. recently used files.
- Avoid using letter with descender like p q g, y, as it would be difficult to find.
Menus and dialog boxes are two most common and standardized UI elements in Win Form. During accessibility implementation ensure that user can enter and exit menu using ALT key or dialog boxes. User can either navigate to menu through arrow keys or can use shortcuts to invoke the functionality.
How to Test Keyboard Accessibility?
It‘s so simple just unplug your mouse and put it in a place where your hand can’t reach it. Now try to use the application.
Do you like the article? Is there anything that I missed or needs more explanation. Then do leave a comment. I would love to hear the feedback.