Search code examples
c++macoswxwidgets

How can I use the control key as a wxWidgets accelerator on a Mac?


wxWidgets seems biased towards Windows, as 'Ctrl' binds to the control key on a Windows machine, but is converted to the command key on a Mac.

menuFile->Append(CONNECT_KEYSTROKE, wxT("&Connect\tCtrl-R"));

The code above shows up as ⌘R in your menu.

How do you bind to the control key on a Mac?


Solution

  • Use 'RawCtrl'

    menuFile->Append(CONNECT_KEYSTROKE, wxT("&Connect\tRawCtrl-R"));
    

    The code above shows up as ^R in your menu.