Qt: Don't forget the mouse flags

This commit is contained in:
Henrik Rydgård
2025-01-23 19:01:30 +01:00
parent 9c94c3f0a2
commit 7ee999e424
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ enum {
TOUCH_RELEASE_ALL = 1 << 6, // Useful for app focus switches when events may be lost.
TOUCH_HOVER = 1 << 7,
// These are the Android getToolType() codes, shifted by 10.
// These are the Android getToolType() codes, shifted by 10. Unused currently.
TOUCH_TOOL_MASK = 7 << 10,
TOUCH_TOOL_UNKNOWN = 0 << 10,
TOUCH_TOOL_FINGER = 1 << 10,
+2 -2
View File
@@ -613,7 +613,7 @@ bool MainUI::event(QEvent *e) {
case Qt::LeftButton:
input.x = ((QMouseEvent*)e)->pos().x() * g_display.dpi_scale * xscale;
input.y = ((QMouseEvent*)e)->pos().y() * g_display.dpi_scale * yscale;
input.flags = (e->type() == QEvent::MouseButtonPress) ? TOUCH_DOWN : TOUCH_UP;
input.flags = ((e->type() == QEvent::MouseButtonPress) ? TOUCH_DOWN : TOUCH_UP) | TOUCH_MOUSE;
input.id = 0;
NativeTouch(input);
break;
@@ -636,7 +636,7 @@ bool MainUI::event(QEvent *e) {
case QEvent::MouseMove:
input.x = ((QMouseEvent*)e)->pos().x() * g_display.dpi_scale * xscale;
input.y = ((QMouseEvent*)e)->pos().y() * g_display.dpi_scale * yscale;
input.flags = TOUCH_MOVE;
input.flags = TOUCH_MOVE | TOUCH_MOUSE;
input.id = 0;
NativeTouch(input);
break;