From c2a23a9ffe3bf3a91441221dc88a57d0fe0284fc Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Wed, 14 Dec 2016 06:23:02 -0800 Subject: [PATCH] check for RAW_CONTROL only on macs in switch stmts On e.g. Windows WXK_RAW_CONTROL == WXK_CONTROL so having both in a switch statement is compile-time error, so wrap the checks for WXK_RAW_CONTROL in an #ifdef __WXMAC__ . --- .gitignore | 2 +- src/wx/panel.cpp | 2 ++ src/wx/widgets/keyedit.cpp | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9cd04a35..79079cea 100644 --- a/.gitignore +++ b/.gitignore @@ -4,7 +4,7 @@ src/wx/cmd-evtable.h src/wx/cmdhandlers.h src/wx/cmdtab.cpp src/wx/wxvbam.xrs -build/ +build* # vim swap files *.sw? diff --git a/src/wx/panel.cpp b/src/wx/panel.cpp index a2739397..b95eb9c1 100644 --- a/src/wx/panel.cpp +++ b/src/wx/panel.cpp @@ -1131,9 +1131,11 @@ static bool process_key_press(bool down, int key, int mod, int joy = 0) case WXK_CONTROL: mod |= wxMOD_CONTROL; break; +#ifdef __WXMAC__ case WXK_RAW_CONTROL: mod |= wxMOD_RAW_CONTROL; break; +#endif } // check if key is already pressed diff --git a/src/wx/widgets/keyedit.cpp b/src/wx/widgets/keyedit.cpp index 75e093da..f568f4f4 100644 --- a/src/wx/widgets/keyedit.cpp +++ b/src/wx/widgets/keyedit.cpp @@ -101,10 +101,12 @@ wxString wxKeyTextCtrl::ToString(int mod, int key) s.append(_("CTRL")); break; - // this is the cmd key on macs + // this is the control key on macs +#ifdef __WXMAC__ case WXK_RAW_CONTROL: s.append(_("RAWCTRL")); break; +#endif default: s.append((wxChar)key);