diff --git a/common/html_messagebox.cpp b/common/html_messagebox.cpp
index 8f30919321..c8789b7cc7 100644
--- a/common/html_messagebox.cpp
+++ b/common/html_messagebox.cpp
@@ -127,3 +127,16 @@ void HTML_MESSAGE_BOX::ShowModeless()
Show( true );
}
+
+
+void HTML_MESSAGE_BOX::OnCharHook( wxKeyEvent& aEvent )
+{
+ // shift-return (Mac default) or Ctrl-Return (GTK) for OK
+ if( aEvent.GetKeyCode() == WXK_ESCAPE )
+ {
+ wxPostEvent( this, wxCommandEvent( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK ) );
+ return;
+ }
+
+ aEvent.Skip();
+}
diff --git a/include/dialog_shim.h b/include/dialog_shim.h
index 2ef79229f8..ba1f8ec992 100644
--- a/include/dialog_shim.h
+++ b/include/dialog_shim.h
@@ -94,7 +94,8 @@ class DIALOG_SHIM : public wxDialog, public KIWAY_HOLDER
*/
void OnButton( wxCommandEvent& aEvent );
- void OnCharHook( wxKeyEvent& aEvt );
+protected:
+ virtual void OnCharHook( wxKeyEvent& aEvt );
public:
diff --git a/include/html_messagebox.h b/include/html_messagebox.h
index 41f2f4bf14..563ee855a6 100644
--- a/include/html_messagebox.h
+++ b/include/html_messagebox.h
@@ -38,6 +38,8 @@ protected:
// Handlers for HTML_MESSAGE_BOX_BASE events.
void OnOKButtonClick( wxCommandEvent& event ) override;
+ virtual void OnCharHook( wxKeyEvent& aEvt ) override;
+
public:
HTML_MESSAGE_BOX( wxWindow* aParent, const wxString& aTitle = wxEmptyString,
const wxPoint& aPosition = wxDefaultPosition,