but I can't make it work in all cases (and I get the same behavior with the Shift key).
- It works if Control key is pressed then mouse is moved with left button down.
- It doesn't work if Control key is pressed then mouse is moved without left button down.
- It doesn't work if mouse is moved with left button down then Control key is pressed.
I tried to get the Control key status by different ways:
Code: Select all
Bind(wxEVT_MOTION, &MyFrame::OnMouseMove, this);
...
void MyFrame::OnMouseMove(wxMouseEvent & event)
{
wxKeyboardState kbs;
if (event.ControlDown() || kbs.ControlDown())
wxLogMessage(wxT("You moved the mouse with Control key down!"));
}
Code: Select all
Bind(wxEVT_KEY_DOWN, &MyFrame::OnKeyDown, this);
...
void MyFrame::OnKeyDown(wxKeyEvent & event)
{
if (event.ControlDown())
wxLogMessage(wxT("You pressed the Control key!"));
}
Many thanks for any idea about this,
Pascal