I'm used to pressing Enter
inside any form control (except <textarea>
) to submit the form. This even works on checkboxes.
When running NVDA or JAWS though, they both intercept Enter
when focusing a checkbox to toggle them - something which usually is possible only with the Space
bar on the keyboard!
I guess this is because neither NVDA nor JAWS enter focus mode when focusing (sic!) checkboxes, similar to links and buttons. But I think this is strange, as for example radio buttons do trigger focus mode! So I think that checkboxes should trigger focus mode, too, even though they do not offer any advanced interaction (eg. arrow keys).
I tested some other special keys, and obviously Up
/Down
/Left
/Right
are intercepted, as they are used for navigation (line by line or character by character). But for example, Esc
is not intercepted. So just out of interest: are there any other peculiarities like this, namely keys that are used by screen readers in a way than in keyboard-only interaction?
Well, I don't think the Enter
key behaviour will ever gonna change, and that's alright. But it's good to be aware of such edge cases and peculiarities. 🤔
I know that for JAWS, the Enter key is used to toggle Forms mode (i.e., the mode to interact with a form field). Forms mode will restrict movement of the virtual cursor using the arrow keys, whereas if the user is not in Forms mode then they are free to read the page with the virtual cursor without accidentally changing any form field values or interacting with components.
It's also worth considering that many screen reader users would not want to inadvertantly submit a form without having reviewed the information first, so JAWS intercepts the Enter key as a way of preventing this from happening.
You're right in that most form fields do automatically toggle Forms mode when the field receives focus, and that's default behaviour. But some users prefer to manually toggle Forms mode themselves by using the Enter key.