rompelstilchen
June 7th, 2014, 11:21 PM
hello,
i am actually writting an app with wxwidget
(i already went to a wxWidget forum but people say the code works perfectly fine on Windows and Debian, ...but not on my Ubuntu box)
as the api allows to filter system to application events, i used this function
int MyApp::FilterEvent(wxEvent& event)
{
if(event.GetEventType()==wxEVT_KEY_DOWN)
cout << "wxEVT_KEY_DOWN" << endl;
else if(event.GetEventType()==wxEVT_KEY_UP)
cout << "wxEVT_KEY_UP" << endl;
}
I get this :
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
...
so it seems the system sends keys up and keys downs
instead of only keys downs (and key up, once the keyboard key gets released)
i should get this:
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_UP
i wondered if someone had a clue what could cause this problem ?
thanks
i am actually writting an app with wxwidget
(i already went to a wxWidget forum but people say the code works perfectly fine on Windows and Debian, ...but not on my Ubuntu box)
as the api allows to filter system to application events, i used this function
int MyApp::FilterEvent(wxEvent& event)
{
if(event.GetEventType()==wxEVT_KEY_DOWN)
cout << "wxEVT_KEY_DOWN" << endl;
else if(event.GetEventType()==wxEVT_KEY_UP)
cout << "wxEVT_KEY_UP" << endl;
}
I get this :
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
wxEVT_KEY_UP
wxEVT_KEY_DOWN
...
so it seems the system sends keys up and keys downs
instead of only keys downs (and key up, once the keyboard key gets released)
i should get this:
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_DOWN
wxEVT_KEY_UP
i wondered if someone had a clue what could cause this problem ?
thanks