问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/27002328/qt-printscreen-key-in-keypressevent