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__ .
This commit is contained in:
Rafael Kitover 2016-12-14 06:23:02 -08:00
parent 7b1b1ea236
commit c2a23a9ffe
3 changed files with 6 additions and 2 deletions

2
.gitignore vendored
View File

@ -4,7 +4,7 @@ src/wx/cmd-evtable.h
src/wx/cmdhandlers.h src/wx/cmdhandlers.h
src/wx/cmdtab.cpp src/wx/cmdtab.cpp
src/wx/wxvbam.xrs src/wx/wxvbam.xrs
build/ build*
# vim swap files # vim swap files
*.sw? *.sw?

View File

@ -1131,9 +1131,11 @@ static bool process_key_press(bool down, int key, int mod, int joy = 0)
case WXK_CONTROL: case WXK_CONTROL:
mod |= wxMOD_CONTROL; mod |= wxMOD_CONTROL;
break; break;
#ifdef __WXMAC__
case WXK_RAW_CONTROL: case WXK_RAW_CONTROL:
mod |= wxMOD_RAW_CONTROL; mod |= wxMOD_RAW_CONTROL;
break; break;
#endif
} }
// check if key is already pressed // check if key is already pressed

View File

@ -101,10 +101,12 @@ wxString wxKeyTextCtrl::ToString(int mod, int key)
s.append(_("CTRL")); s.append(_("CTRL"));
break; break;
// this is the cmd key on macs // this is the control key on macs
#ifdef __WXMAC__
case WXK_RAW_CONTROL: case WXK_RAW_CONTROL:
s.append(_("RAWCTRL")); s.append(_("RAWCTRL"));
break; break;
#endif
default: default:
s.append((wxChar)key); s.append((wxChar)key);