Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The first kind is the input focus and the second kind is the default button in a dialog (not really a kind of focus): "If the button is in a dialog box, the user can select the button by pressing the ENTER key, even when the button does not have the input focus."[1]

[1] https://docs.microsoft.com/en-us/windows/win32/controls/butt...



I feel like it is almost its own kind of focus because that state can be lost, though I don't remember how. Multi-line text boxes maybe.


Yeah, there are definitely some non-obvious details in its behavior. The default button focus moves with the input focus to other buttons but reverts to the default default button if you focus another kind of control. Raymond Chen has an explanation: https://devblogs.microsoft.com/oldnewthing/20040802-00/?p=38...


Aha, thanks for that!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: