I have a wxPanel on which I have a wxEVT_MOTION, wxEVT_LEFT_DOWN and wxEVT_LEFT_UP event set up. But I want to do something else if say Ctrl + LMB is pressed instead of just LMB. So I tried adding this to the wxEVT_LEFT_DOWN as a check before I do something with it,
Code: Select all
wxKeyboardState kbd_state;
if (kbd_state.ControlDown())
wxLogDebug("Control pressed");
But this is not doing anything, doesn't print the statement. I also tried catching wxEVT_KEY_DOWN,
Code: Select all
void WaveformViewer::OnPressCtrl(wxKeyEvent& event)
{
if (event.ControlDown() && this->HasFocus())
wxLogDebug("Panel has focus and control pressed.");
}
But this also does nothing. What am I doing wrong?