PDA

View Full Version : Event propagation-Windows key special case



hanumanth
16th April 2010, 15:46
Hi,

I am using Qt 4.5 in SUSE 11,GNOME desktop environment.I used bool event(QEvent *event) to collect the keyboard key strokes.I am receiving the events
of all the keys.
Code
bool event(QEvent *event)// event handler
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
codevalue = keyEvent->nativeScanCode();
// I check the codevalue for each stroke and handle the corresponding key

}
But when Windows key( also known as Super key/Meta key) is pressed I am unable to catch the event.
1.Is the windows key event is first going to SUSE GNOME Windows Manager or first coming to my Qt application.
2.Is my appplication first getting the event and then event is propagated to GNOME Desktop Manager.
3.When I press windows key , GNOME panel menu pops up and so my application is not receiving the KeyStroke.

I used eventFilter, accept(),grabKeyboard(),setFocus() to catch the event, but none of them worked.
I also tried several times using Key_Super_L, Key_Super_R or Key_Meta to catch the windows key event, but unable to fetch the event..

Please let me know if there is any special way of handling the Window key in Qt. Or Should I use X11 calls to suppress the Windows key in SUSE.

Thanks,
Hanumanth..