PDA

View Full Version : Key_Print- application is not capturing PrintScreen event



hanumanth
16th April 2010, 17:12
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 PrintScreen key is pressed , I am unable to capture the event. I am getting "save as a screenshot popup" and my application
is not getting the event.
1.Is the PrintScreen key first captured by SUSE GNOME environment.
2.Is my appplication first getting the event and then event is propagated to GNOME Desktop Manager.
3.When I press Print Screen key ," Save as a screenshot message" pops up and so my application is not receiving the KeyStroke.

I used eventFilter, accept(),grabKeyboard(),setFocus(),Key_Print to capture the Printscreen event, but none of them worked.

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

Thanks,
Hanumanth.