EventFilter Print Screen key?
-
Hey all so I've setup a simple eventfilter to run a few tests on capturing keyboard input to build a QKeySequence, here it what I have setup
.cpp file
@test::test(QWidget *parent) : QWidget(parent), ui(new Ui::Options)
{
ui->setupUi(this);
ui->txtHotkey->installEventFilter(this);
}bool test::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::KeyPress)
{
QKeyEvent keyEvent = static_cast<QKeyEvent>(event);qDebug() << "key int: " << keyEvent->key(); } return QWidget::eventFilter(obj, event);
}@
Now this works great for almost all keys however nothing happens when I press the "Print Screen" key on my keyboard why is this? as this is one of the keys I would really like to grab.