Skip to main content
Select a theme to activate music mode, and use your keyboard to play a tune.

NVDA eats keydown events for breakfast

NVDA (when in browse mode) gobbles up keydown events and doesn't forward them on to the browser.

To an extent I can rationalise this behaviour. Browse mode exists to enable easy navigation of a page and one of the features it offers is Single Letter Navigation, which binds individual characters to page elements, such that pressing K will navigate you to the next link, Shift+B will navigate you to the previous button, etc. It can be assumed that, while in browse mode, the user is more interested in browsing the page than interacting with it, so the intent behind a keypress is most likely navigation rather than interaction.

Not all events get devoured by NVDA while in browse mode though. Some events, such as click, do still get sent to the page when Enter or Space is pressed. This enables interaction with links, buttons, and other interactive elements on a page which are set-up to respond to a mouse click.

I first spotted this behaviour while testing a navigation bar with NVDA. The default behaviour was that dropdowns would expand when hovered over, rather than when clicked. As an affordance for screen readers, a keydown listener was added which detected Enter or Space key presses and toggled the dropdown between expanded and collapsed. When testing this with NVDA, however, the menu would never expand. If I switched to focus mode and pressed Enter or Space, however, it would work as expected.

My recommended resolution was to allow users to replace the keydown listener with a click listener. That resolved the issue for NVDA users, and also gave users the option of toggling the menu to a semi-permanent expanded state.