When I pressing keys, this code works, but not with Print Screen key.
void KeyHooker::keyPressEvent(QKeyEvent *event)
{
qDebug() << event->key();
}
Q. How can I grab Print Screen key?
The problem is that the OS grabs this before it reaches your code: http://qt-project.org/forums/viewthread/18610/#90901
You'll need to use Microsoft's LowLevelKeyboardProc in your code to do this: http://msdn.microsoft.com/en-us/library/ms644985%28v=VS.85%29.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With