Qt: printscreen key in keyPressEvent

When I press the keys, this code works, but not with the Print Screen button.

void KeyHooker::keyPressEvent(QKeyEvent *event)
{
    qDebug() << event->key();
}

      

Q. How can I capture the print screen key?

+3


source to share


1 answer


The problem is the OS grabs this before it reaches your code: http://qt-project.org/forums/viewthread/18610/#90901



For this you need to use Microsoft LowLevelKeyboardProc

for this: http://msdn.microsoft.com/en-us/library/ms644985%28v=VS.85%29.aspx

+3


source







All Articles