liveBook · Manning

Keyboard interaction

As explained in Architecting Accessibility

Operating an interface using only a keyboard, without relying on a pointing device.

Keyboard interaction means using an interface without a mouse or touchscreen. It can be an adaptive strategy for someone who finds fine pointer movements difficult, a way to use a screen reader, or simply a faster way to work. A keyboard-friendly website lets people reach and operate all its functionality, not just move through its links. section 2.2 section 5.3

Give pointer actions a keyboard route

A file-upload widget may accept dragged-and-dropped files, but it also needs a route through form controls so someone using only a keyboard can upload a file. Ask of every pointer or touch action: can the same task be completed without it? section 5.3

People commonly navigate with Tab and Shift+Tab, and use keys such as arrows, Spacebar, and Enter. Movement alone is not enough: a visible focus indicator must show which control will respond. Without one, navigating can feel like editing a document without a cursor. A faint indicator may force someone to retrace their Tab presses instead of concentrating on their task. section 5.3.1

Check the whole journey, not just whether Tab moves:

  • Can every piece of content and functionality be reached and used, in an order that feels logical? section 5.3
  • Is focus clearly visible, including when a pop-up or another page element might cover it? section 5.3 section 5.3.1
  • When a modal dialog opens, does focus stay within it and return to its triggering control when it closes? section 5.3

TIP: Make the focused control easy to spot at a glance. An outline can be combined with an underline or shaded background; an input can use a thicker outline and a contrasting outer border. Check that the result remains visible across backgrounds. section 5.3.1

:root {
  --cookie-banner-height: 10rem; #A
  --focus-padding: 1rem; #A
}
 
html {
  scroll-padding-bottom: calc(var(--cookie-banner-height) + var(--focus-padding)); #B
}

body {
  padding-block-end: var(--cookie-banner-height); #C
  ...
}

NOTE: A sticky cookie banner can hide the control that has focus. This CSS example reserves space for the banner and adds bottom scroll padding so focused content is less likely to sit beneath it. section 5.3.1

How Architecting Accessibility covers it

How deep it goes
Develops practical checks for access, focus order, visibility, and modal behavior, with a CSS adjustment for obscured focus.
Examples
Uses file upload, repetitive test-result exports, custom focus indicators, and a cookie banner hiding focused controls.
What it assumes
Introduces the basic navigation keys and focus indicators without requiring prior knowledge of keyboard navigation.
What you can do after
Evaluate/understand whether a website supports keyboard-only tasks and keeps focus visible and predictable.
How it connects
Connects adaptive strategies with screen readers, focus indicators, modal dialogs, and keyboard navigation.

Also explained in

Compare how 4 books explain keyboard interaction →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Architecting Accessibility. The section links point to the parts of the book it draws on.