From 28e0c28ee349c3aa5a5373f4540e3a6f726534c8 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Tue, 28 Sep 2004 00:13:53 +0000 Subject: [PATCH] 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 --- contrib/src/stc/stc.cpp | 7 +++++++ contrib/src/stc/stc.cpp.in | 7 +++++++ src/stc/stc.cpp | 7 +++++++ src/stc/stc.cpp.in | 7 +++++++ 4 files changed, 28 insertions(+) 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(); -- 2.47.2