Mark `wxEVT_KEY_DOWN` as processed in `wxvbamApp` (#1424)

This prevents wxWidgets from triggering the alert sound on macOS.
There should be no side effect from this.

Fixes #1384
This commit is contained in:
Fabrice de Gans 2025-03-22 16:24:14 -07:00 committed by GitHub
parent 57211ddc77
commit 3fdc30f7d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View File

@ -1409,3 +1409,12 @@ int wxvbamApp::FilterEvent(wxEvent& event)
return user_input_event.FilterProcessedInput(user_input.value());
}
bool wxvbamApp::ProcessEvent(wxEvent& event) {
if (event.GetEventType() == wxEVT_KEY_DOWN) {
// Mark the event as processed. This prevents wxWidgets from firing alerts on macOS.
// See https://github.com/wxWidgets/wxWidgets/issues/25262 for details.
return true;
}
return wxApp::ProcessEvent(event);
}

View File

@ -84,6 +84,7 @@ public:
return false;
}
}
bool ProcessEvent(wxEvent& event) final;
wxString GetConfigDir();
wxString GetDataDir();