X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/63415ba9f5331b2b96215f8a570e05623ea6ec42..475f991da54f0cdc4449fdfab0618e5ae26fced9:/src/common/dlgcmn.cpp diff --git a/src/common/dlgcmn.cpp b/src/common/dlgcmn.cpp index d95dafd786..5cbbc7e390 100644 --- a/src/common/dlgcmn.cpp +++ b/src/common/dlgcmn.cpp @@ -461,14 +461,16 @@ bool wxDialogBase::SendCloseButtonClickEvent() bool wxDialogBase::IsEscapeKey(const wxKeyEvent& event) { - // for most platforms, Esc key is used to close the dialogs - return event.GetKeyCode() == WXK_ESCAPE && - event.GetModifiers() == wxMOD_NONE; + // For most platforms, Esc key is used to close the dialogs. + // + // Notice that we intentionally don't check for modifiers here, Shift-Esc, + // Alt-Esc and so on still close the dialog, typically. + return event.GetKeyCode() == WXK_ESCAPE; } void wxDialogBase::OnCharHook(wxKeyEvent& event) { - if ( event.GetKeyCode() == WXK_ESCAPE ) + if ( IsEscapeKey(event) ) { if ( SendCloseButtonClickEvent() ) {