I'm new to QT from Java. Is there something like this: https://code.google.com/p/jnativehook/ for QT? Can I get all the mouse events with coordinates? I've done the following:
bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::MouseButtonRelease)
{
QMouseEvent *mouseEvent = static_cast<QMouseEvent*>(event);
ui->listWidget->addItem(QString("Mouse pressed: %1,%2").arg(mouseEvent>pos().x()).arg(mouseEvent->pos().y()));
}
return false;
}
This works fine but it only does it inside my Application and not system wide. What can I do to get this working in QT? Also this only needs to run on windows...
It's actually very simple. I did not find ANY examples or anything.
I then found a video on YouTube which shows exactly what I'm searching for (For the keyboard but the mouse is basically the same).
So if ever someone needs this here you go:
The following codes can be used inside the switch to detect which event was received: