From 5b322275839ab6e5f21f4a90a25c0fde83cd13ff Mon Sep 17 00:00:00 2001 From: Rodion Stashinsky Date: Tue, 23 Sep 2025 18:33:04 +0300 Subject: [PATCH] fix peripherals.dart: correct middle mouse button handling Previously, the condition `if (rightButtonPressed || middleButtonPressed)` prevented the middle button from ever returning its intended value (1). Now right button returns 2, and middle button returns 1 as expected. Fixes #104 --- packages/three_js_core/lib/others/peripherals.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/three_js_core/lib/others/peripherals.dart b/packages/three_js_core/lib/others/peripherals.dart index 1fb5d7a..89b5f43 100755 --- a/packages/three_js_core/lib/others/peripherals.dart +++ b/packages/three_js_core/lib/others/peripherals.dart @@ -341,7 +341,7 @@ class WebPointerEvent { // Left button takes precedence over other if (leftButtonPressed) return 0; // 2nd priority is the right button - if (rightButtonPressed || middleButtonPressed) return 2; + if (rightButtonPressed) return 2; // Lastly the middle button if (middleButtonPressed) return 1;