Operable · 2.5 Input Modalities

Motion Actuation WCAG 2.5.4 · Level A

Anything triggered by moving the device, such as shaking or tilting, or by user motion toward a camera, must also be operable through user interface components, and responding to motion must be able to be turned off. Motion used through an accessibility supported interface, or that is essential, is exempt.

Level
A
Since
WCAG 2.1
Principle
Operable
Guideline
2.5 Input Modalities

Live demo

Undo without shaking the phone

The same task, done two ways: switch between the version that passes and the one that fails, or put them side by side. Everything in the box is live, so try it with a keyboard, a pointer or a screen reader.

A sentence was deleted by mistake. Undo it without shaking the device, then switch to Fails and try again.

Live example

Passes

Email to Sam

I will bring the tickets on Friday. Meet me at the main gate at six.

You deleted a sentence by mistake. Shake the phone to undo.

What happened

    Why it passes

    The Undo button does what shaking does, so someone whose phone is mounted on a wheelchair can still undo. The checkbox turns shaking off, so a tremor or a bumpy bus ride cannot undo things by accident.

    Why it fails

    Shaking is the only way to undo. People who cannot hold or shake the device are stuck, and people with a tremor may undo changes they wanted to keep.

    Examples

    Code that fails, and the fix

    Four examples, each one running: the usual ways this criterion fails, and code that passes. Listen to them, measure them, or copy the code.

    01What changes 4 lines

    Fails

    Shaking is the only way to undo

    Live preview

    JavaScript
    // Shaking the phone is the only way to undo the last edit.window.addEventListener('devicemotion', (e) => {  const a = e.accelerationIncludingGravity;  if (!a) return;  if (Math.hypot(a.x, a.y, a.z) > 25) undoLastEdit();});

    Someone whose phone is mounted on a wheelchair cannot undo at all, and nothing turns the motion off, so a tremor or a bumpy ride can undo work by accident.

    Passes

    An Undo button and a way to switch shaking off

    Live preview

    JavaScript
    // The same undo is on a button, and shaking can be turned off.const shakeOff = document.getElementById('shake-off'); // "Turn off shake to undo" checkboxdocument.getElementById('undo').addEventListener('click', undoLastEdit);window.addEventListener('devicemotion', (e) => {  const a = e.accelerationIncludingGravity;  if (shakeOff.checked || !a) return;  if (Math.hypot(a.x, a.y, a.z) > 25) undoLastEdit();});

    The Undo button does the same job without any motion, and the checkbox stops the page from responding to shakes.

    Fails

    Tilting is the only way to change step

    Live preview

    JavaScript
    // Tilting the tablet left or right is the only way to change recipe step.let tilted = false;window.addEventListener('deviceorientation', (e) => {  if (e.gamma === null) return;  if (Math.abs(e.gamma) < 20) { tilted = false; return; }  if (tilted) return;  tilted = true;  showStep(e.gamma > 0 ? step + 1 : step - 1);});

    A cook whose tablet sits in a stand, or anyone who cannot tilt it, stays on the first step of the recipe.

    Passes

    Step buttons, with tilting as an opt-in

    Live preview

    HTML
    <div role="group" aria-label="Recipe steps">  <button type="button" id="prev-step">Previous step</button>  <p id="step-count">Step 2 of 6</p>  <button type="button" id="next-step">Next step</button></div><label><input type="checkbox" id="tilt-on"> Change step by tilting</label>

    The buttons do what the tilt did. Tilting only works after the person ticks the box, so it cannot fire by accident.

    Why it matters

    Who it helps

    People who cannot shake or tilt a device, including those with devices mounted on a wheelchair, need another way to use the function, and people with tremor need to switch motion off to avoid triggering it by accident.

    W3C: Understanding 2.5.4
    • Level A

      Level A is the minimum: failing it can shut some people out completely.

    • In WCAG versions

      Added in WCAG 2.1 in June 2018, and kept in 2.2.

      No WCAG 1.0 checkpoint maps to it.

    • Where it is required

      Required where the law names WCAG 2.1 or later at this level: the United States, Canada, the European Union, the United Kingdom, France, Germany, Italy, Spain, the Netherlands, Ireland, Norway, Switzerland, India, Australia and New Zealand.

    How to test

    Checking it

    A few concrete steps. Automated tools find some failures; most need a person.

    1. Identify features that respond to shaking, tilting, device orientation changes or gestures detected by a camera.
    2. Confirm each has an on-screen control that does the same thing, and a setting that turns off the motion response.

    Common failures

    Where it breaks

    • A shake-to-shuffle or shake-to-refresh feature has no on-screen button and cannot be turned off.
    • A tilt-to-scroll interface offers no alternative controls, so users who cannot tilt the device cannot scroll.