# Motion Actuation: Shake and Tilt Need a Button

Source: https://allyway.ai/glossary/motion-actuation

Motion Actuation is WCAG success criterion 2.5.4 (Level A). Functionality that can be operated by device motion or user motion can also be operated by user interface components, and responding to the motion can be disabled to prevent accidental actuation.

Motion actuation means triggering a function by moving: shaking the phone to undo, tilting it to turn a page, or waving at the camera. WCAG 2.5.4 asks that every such function also works with normal controls like buttons, and that people can switch the motion response off. Someone whose phone is mounted on a wheelchair cannot shake it, and someone with a tremor may shake it without meaning to.

## What it means

[WCAG 2.5.4 Motion Actuation](https://www.w3.org/WAI/WCAG22/Understanding/motion-actuation.html) is a Level A criterion. Functionality that can be operated by device motion or user motion can also be operated by user interface components, and responding to the motion can be disabled to prevent accidental actuation – except in two cases:

| Exception | Meaning |
|---|---|
| Supported interface | The motion is used to operate functionality through an accessibility supported interface |
| Essential | The motion is essential for the function and doing so would invalidate the activity |

The criterion is about motion read by sensors such as the accelerometer or a camera. Typing, moving a mouse, touchscreen gestures and the use of assistive technology are not what it targets – touch gestures are covered by [pointer gestures](https://allyway.ai/glossary/pointer-gestures) (2.5.1).

W3C names who benefits: people who cannot perform certain movements, people whose device is on a fixed mount, for example on a wheelchair, and anyone who cannot move their device at the moment. Turning motion off helps people with tremors or other motor impairments avoid triggering functions by accident.

> **Note:** > **Two requirements, not one**
> A button alternative alone is not enough. People must also be able to stop the page from reacting to motion. W3C failure technique F106 describes the case where motion actuation cannot be turned off. W3C also notes that respecting an operating system setting that disables motion detection can meet this.

The rule is related to [orientation](https://allyway.ai/glossary/orientation) (1.3.4), which asks that content works in portrait and landscape – a tilt that changes content must not lock people out either way.

## Examples

```html title="Example"
<!-- Shake to undo, with a button that does the same and a switch to turn it off -->
<label for="note">Note</label>
<textarea id="note"></textarea>
<button type="button" id="undo">Undo</button>

<label>
  <input type="checkbox" id="motion-off"> Turn off shake to undo
</label>

<script>
  const motionOff = document.getElementById('motion-off');
  document.getElementById('undo').addEventListener('click', undo);
  window.addEventListener('devicemotion', (e) => {
    if (motionOff.checked) return;          // the user switched motion off
    if (isShake(e.accelerationIncludingGravity)) undo();
  });
</script>
```

Both W3C examples work this way: shake to undo has an undo button next to the field, and tilting to change pages has previous and next buttons. Make these buttons easy to hit with enough [target size](https://allyway.ai/glossary/target-size) and reachable by [keyboard navigation](https://allyway.ai/glossary/keyboard-navigation).

**Do:** Do

Offer a visible button for every motion function, add a setting that turns motion responses off, keep the setting where people find it before the first accidental shake, and test with the device lying still on a table.

**Don't:** Don't

Make shaking the only way to undo or report a problem, change pages only by tilting, start a game action only with a wave at the camera, or hide the off switch deep in a settings menu.

## How to check motion actuation



## Questions

Q: What counts as motion actuation?
A: Operating a function by moving the device, such as shaking or tilting it, or by moving in front of it, such as a gesture a camera reads. Touch gestures, typing and mouse movement are not meant.

Q: Is shake to undo allowed under WCAG?
A: Yes, if the same undo is available through a normal control such as a button, and people can turn off the response to shaking.

Q: Why must motion be possible to turn off?
A: People with tremors or other motor impairments may move their device without meaning to. Without a way to turn the response off, they trigger actions by accident.

Q: When is motion essential?
A: When removing it would invalidate the activity – for example a step counter or an app whose purpose is to measure movement. For undo, navigation or confirming an action, motion is not essential.
