Skip to content

Commit

Permalink
check for RAW_CONTROL only on macs in switch stmts
Browse files Browse the repository at this point in the history
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__ .
  • Loading branch information
rkitover committed Dec 14, 2016
1 parent 7b1b1ea commit c2a23a9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 2 additions & 0 deletions src/wx/panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion src/wx/widgets/keyedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c2a23a9

Please sign in to comment.