> For the complete documentation index, see [llms.txt](https://ebay.gitbook.io/oatmeal/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ebay.gitbook.io/oatmeal/keyboard.md).

# Keyboard Methods

### Prerequisites

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

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

### Methods

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

### 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)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ebay.gitbook.io/oatmeal/keyboard.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
