View Issue Details

IDProjectCategoryView StatusLast Update
0002936NoesisGUIUnitypublic2024-01-29 18:06
Reporterstonstad Assigned Tojsantos  
PrioritynormalSeveritymajor 
Status resolvedResolutionfixed 
Product Version3.2.2 
Target Version3.2.3Fixed in Version3.2.3 
Summary0002936: World UI Responds to Mouse Events When Cursor Hidden and Locked
Description

Noesis World UI responds to mouse over events when the Unity cursor is hidden and locked. Unity places the cursor at the screen space center and locks it into place. I do not believe there a scenario in which an end user desires to have world UI elements respond to events when the cursor is both hidden and locked in position. Modifying the behavior to follow what NoesisView does would be more consistent.

PlatformAny

Relationships

related to 0002929 resolvedjsantos WorldSpaceUI and NoesisView Event Dispatch - ev.Use() 

Activities

jsantos

jsantos

2024-01-29 18:06

manager   ~0009137

Patch attached.

NoesisView.cs.patch (1,728 bytes)   
Index: NoesisView.cs
===================================================================
--- NoesisView.cs	(revision 13245)
+++ NoesisView.cs	(working copy)
@@ -1064,6 +1064,11 @@
       #endif
     }
 
+    private static bool IsCursorVisible()
+    {
+        return UnityEngine.Cursor.visible && UnityEngine.Cursor.lockState != CursorLockMode.Locked;
+    }
+
     private Vector3 MousePosition()
     {
       #if ENABLE_LEGACY_INPUT_MANAGER
@@ -1085,7 +1090,7 @@
 
     private void UpdateMouse()
     {
-        if (HasMouse())
+        if (HasMouse() && IsCursorVisible())
         {
             Vector3 mousePos = MousePosition();
 
@@ -1681,7 +1686,7 @@
         {
             case UnityEngine.EventType.MouseDown:
             {
-                if (enableMouse)
+                if (enableMouse && IsCursorVisible())
                 {
                     UnityEngine.Vector2 mouse = ProjectPointer(ev.mousePosition.x, UnityEngine.Screen.height - ev.mousePosition.y);
 
@@ -1706,7 +1711,7 @@
             }
             case UnityEngine.EventType.MouseUp:
             {
-                if (enableMouse)
+                if (enableMouse && IsCursorVisible())
                 {
                     UnityEngine.Vector2 mouse = ProjectPointer(ev.mousePosition.x, UnityEngine.Screen.height - ev.mousePosition.y);
 
@@ -1724,7 +1729,7 @@
             }
             case UnityEngine.EventType.ScrollWheel:
             {
-                if (enableMouse)
+                if (enableMouse && IsCursorVisible())
                 {
                     UnityEngine.Vector2 mouse = ProjectPointer(ev.mousePosition.x, UnityEngine.Screen.height - ev.mousePosition.y);
 
NoesisView.cs.patch (1,728 bytes)   

Issue History

Date Modified Username Field Change
2023-12-12 15:34 stonstad New Issue
2023-12-12 15:59 stonstad Description Updated
2023-12-12 18:23 jsantos Assigned To => jsantos
2023-12-12 18:23 jsantos Status new => assigned
2023-12-12 18:23 jsantos Target Version => 3.2.3
2023-12-12 18:23 jsantos Relationship added related to 0002929
2024-01-22 11:47 sfernandez Target Version 3.2.3 => 3.2.4
2024-01-22 11:58 jsantos Target Version 3.2.4 => 3.2.3
2024-01-29 18:06 jsantos Note Added: 0009137
2024-01-29 18:06 jsantos File Added: NoesisView.cs.patch
2024-01-29 18:06 jsantos Status assigned => resolved
2024-01-29 18:06 jsantos Resolution open => fixed
2024-01-29 18:06 jsantos Fixed in Version => 3.2.3
2025-10-10 13:29 jsantos Category Unity3D => Unity