void MainWindow::mousePressEvent(QMouseEvent* event)
{
if(event->button() == Qt::LeftButton)
{
timer->start(timer_time);
}
}
void MainWindow::mouseReleaseEvent(QMouseEvent* event)
{
if(event->button() == Qt::LeftButton)
{
timer->stop();
}
}
This code works when i use it inside my appliacation, but if I want use it outside it won't be working. How can I do this? It should start timer when LeftButton is pressed and stop when LeftButton release.
SOLUTION: understanding-the-low-level-mouse-and-keyboard-hook-win32