Implement mousewheel vertical scroll and hover in ImGui integration

This commit is contained in:
Henrik Rydgård committed 2024-11-06 22:00:11 +01:00
1 parent 673c22a9c4
commit dff7f5704a
5 files changed
+42 -21

No files matched your search

+11 -12
View File
@@ -680,19 +680,18 @@ namespace MainWindow
float y = (float)cursorY * g_display.dpi_scale_y;
WindowsRawInput::SetMousePos(x, y);
if (wParam & (MK_LBUTTON | MK_RBUTTON)) {
TouchInput touch{};
touch.flags = TOUCH_MOVE | TOUCH_MOUSE;
if (wParam & MK_LBUTTON) {
touch.buttons |= 1;
}
if (wParam & MK_RBUTTON) {
touch.buttons |= 2;
}
touch.x = x;
touch.y = y;
NativeTouch(touch);
// Mouse moves now happen also when no button is pressed.
TouchInput touch{};
touch.flags = TOUCH_MOVE | TOUCH_MOUSE;
if (wParam & MK_LBUTTON) {
touch.buttons |= 1;
}
if (wParam & MK_RBUTTON) {
touch.buttons |= 2;
}
touch.x = x;
touch.y = y;
NativeTouch(touch);
}
break;