diff --git a/app/main.cpp b/app/main.cpp index 1de4a258..b7d57853 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -753,6 +754,16 @@ int main(int argc, char *argv[]) QGuiApplication app(argc, argv); +#ifdef Q_OS_DARWIN + // macOS defaults "Keyboard navigation" to text fields and lists only, which + // prevents Tab (and the gamepad navigation that synthesizes it) from moving + // focus between non-text controls on the settings page. Force Tab to reach + // all controls so keyboard and gamepad UI navigation work without requiring + // the user to enable a system accessibility setting. Other platforms already + // default to this behavior. + app.styleHints()->setTabFocusBehavior(Qt::TabFocusAllControls); +#endif + #ifdef Q_OS_UNIX // Register signal handlers to arbitrate between SDL and Qt. // NB: This has to be done after the QGuiApplication is constructed to