Qt: Fix some mouse presses at high click rate not registering

This commit is contained in:
Connor McLaughlin 2020-12-19 16:33:51 +10:00
parent 81aad196e8
commit 175bc66c91
1 changed files with 2 additions and 1 deletions

View File

@ -121,10 +121,11 @@ bool QtDisplayWidget::event(QEvent* event)
}
case QEvent::MouseButtonPress:
case QEvent::MouseButtonDblClick:
case QEvent::MouseButtonRelease:
{
const u32 button_index = CountTrailingZeros(static_cast<u32>(static_cast<const QMouseEvent*>(event)->button()));
emit windowMouseButtonEvent(static_cast<int>(button_index + 1u), event->type() == QEvent::MouseButtonPress);
emit windowMouseButtonEvent(static_cast<int>(button_index + 1u), event->type() != QEvent::MouseButtonRelease);
return true;
}