From: Robin Dunn Date: Tue, 28 Sep 2004 00:13:53 +0000 (+0000) Subject: On the Mac the Alt key is a character modifier like Shift, so let char X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/28e0c28ee349c3aa5a5373f4540e3a6f726534c8 On the Mac the Alt key is a character modifier like Shift, so let char events with AltDown proceed into Scintilla. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29482 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/src/stc/stc.cpp b/contrib/src/stc/stc.cpp index c57c858a95..57ba993f8f 100644 --- a/contrib/src/stc/stc.cpp +++ b/contrib/src/stc/stc.cpp @@ -2727,7 +2727,14 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { // to let the char through in that case, otherwise if only ctrl or only // alt let's skip it. bool ctrl = evt.ControlDown(); +#ifdef __WXMAC__ + // On the Mac the Alt key is just a modifier key (like Shift) so we need + // to allow the char events to be processed when Alt is pressed. + // TODO: Should we check MetaDown instead in this case? + bool alt = false; +#else bool alt = evt.AltDown(); +#endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); int key = evt.GetKeyCode(); diff --git a/contrib/src/stc/stc.cpp.in b/contrib/src/stc/stc.cpp.in index 7ed874510f..c753a6e315 100644 --- a/contrib/src/stc/stc.cpp.in +++ b/contrib/src/stc/stc.cpp.in @@ -501,7 +501,14 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { // to let the char through in that case, otherwise if only ctrl or only // alt let's skip it. bool ctrl = evt.ControlDown(); +#ifdef __WXMAC__ + // On the Mac the Alt key is just a modifier key (like Shift) so we need + // to allow the char events to be processed when Alt is pressed. + // TODO: Should we check MetaDown instead in this case? + bool alt = false; +#else bool alt = evt.AltDown(); +#endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); int key = evt.GetKeyCode(); diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index c57c858a95..57ba993f8f 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -2727,7 +2727,14 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { // to let the char through in that case, otherwise if only ctrl or only // alt let's skip it. bool ctrl = evt.ControlDown(); +#ifdef __WXMAC__ + // On the Mac the Alt key is just a modifier key (like Shift) so we need + // to allow the char events to be processed when Alt is pressed. + // TODO: Should we check MetaDown instead in this case? + bool alt = false; +#else bool alt = evt.AltDown(); +#endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); int key = evt.GetKeyCode(); diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index 7ed874510f..c753a6e315 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -501,7 +501,14 @@ void wxStyledTextCtrl::OnChar(wxKeyEvent& evt) { // to let the char through in that case, otherwise if only ctrl or only // alt let's skip it. bool ctrl = evt.ControlDown(); +#ifdef __WXMAC__ + // On the Mac the Alt key is just a modifier key (like Shift) so we need + // to allow the char events to be processed when Alt is pressed. + // TODO: Should we check MetaDown instead in this case? + bool alt = false; +#else bool alt = evt.AltDown(); +#endif bool skip = ((ctrl || alt) && ! (ctrl && alt)); int key = evt.GetKeyCode();