keyboard events
Events such as keydown and keyup fired when the user presses and releases keys.
In more detail
keypress is deprecated; use keydown and check event.key, such as 'Tab' or 'Escape'. A focus trap listens for Tab on keydown.
Related terms
- focus trap — Code that keeps keyboard focus inside a container, such as an open modal, wrapping from the last element back to the first.
- keyboard accessibility — Making every feature usable with a keyboard alone, with a visible focus indicator and a sensible order.
Taught in
- Pointer Events, Focus Trapping And Keyboard Accessibility — Frontend Architecture & Web Platform
- Core Web Vitals: Measuring And Optimizing LCP, INP, And CLS — Frontend Architecture & Web Platform