In GUI dialogs, most applications provide for keyboard control as follows:
- Enter key - presses the default button. (Default is usually indicated with a bold button border.)
- Esc key - presses the Cancel or close button.
- Space key - presses widget that currently has keyboard focus.
- Tab key - advances focus to next widget.
Question is, when keyboard focus is on a widget that is a button, should the default button be changed to be the one with focus?
I see some issues with this behavior:
- The display noise of redrawing buttons to unbold the outline of original default button and rebold the button under focus as being new default.
- The Space key is now somewhat redundant with Enter key.
- There is no keyboard accelerator to get the normal default button now (Usually the OK button).
However, it seems the trend has been in this direction to change the default button with focus change to another button. What is the rationale for this departure from the early GUIs? It would seem to provide less functionality given there is no way to press the original default button. Did people find that the original model was too complicated for users to understand? I would think keyboard control of dialogs would be a task for advanced users who would have no trouble understanding the model and prefer to have accelerator for current button (Space) and original default button (Enter) at all times.
Note that Qt for one is supporting the change: QPushButton's autoDefault property is responsible for the behavior of changing the default button. By default its value is true. Therefore, you must take extra action to set it to false for all buttons, to prevent them from becoming the default button when focused.