# Keyboard Methods

### Prerequisites

If using Safari, make sure you [fix tabbing in Safari](https://ebay.gitbook.io/oatmeal/help/fix-safari-tabbing) before performing any keyboard testing.

To ensure there are no false positives, disable screen reader or any other assistive technology.

### Methods

* [Focus Moveable](https://ebay.gitbook.io/oatmeal/keyboard/focus-is-not-trapped)
* [Focus Visible](https://ebay.gitbook.io/oatmeal/keyboard/focus-is-visible)
* [Focus Reachable](https://ebay.gitbook.io/oatmeal/keyboard/keyboard-reachable)
* [Focus Management](https://ebay.gitbook.io/oatmeal/keyboard/focus-management)
* [Skip to Main](https://ebay.gitbook.io/oatmeal/keyboard/skip-to-main)
* [Buttons and Links](https://ebay.gitbook.io/oatmeal/keyboard/buttons-and-links)

### What is keyboard accessibility?

Keyboard accessibility is sometimes essential for other types of accessibility.

* Users without fine motor control to use a pointing device rely on some sort of key-based input.
* Users without sight can't see where the mouse pointer is.
* Users may also just prefer to use the keyboard alone instead of switching back and forth between a keyboard and mouse.

There are five general principles that need to be met for keyboard accessibility.

* Focus Moveable: users can traverse through the entire page without getting trapped.
* Focus Visible: users can see where they are at all times.
* Focus Reachable: users can get to all interactive elements on a page.
* Focus Activatable: users can interact with all interactive elements on a page.
* Focus Management: When page content changes, keyboard focus *might* need to be moved somewhere that makes sense.

#### Exceptions

* Input is dependent on the user's movement
  * Handwriting
  * Brush strokes
* Simulation of real-world controls
* Trapping focus within a modal dialog

### Should I test keyboard accessibility on mobile devices?

Yes! Users navigate their mobile devices via Bluetooth Keyboard. We recommend the [Logitech K480](https://www.logitech.com/en-us/products/keyboards/k480-multi-device-wireless.920-006343.html) for testing.

### Guidelines

* [WCAG 2.1.1 (A)](http://www.w3.org/TR/UNDERSTANDING-WCAG20/keyboard-operation-keyboard-operable.html)
* [WCAG 2.1.2 (A)](http://www.w3.org/TR/UNDERSTANDING-WCAG20/keyboard-operation-trapping.html)
* [WCAG 2.4.3 (A)](http://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-focus-order.html)
* [WCAG 2.4.7 (AA)](http://www.w3.org/TR/UNDERSTANDING-WCAG20/navigation-mechanisms-focus-visible.html)
