Search Issue Tracker
Won't Fix
Votes
0
Found in [Package]
1.8.0-pre.2
Issue ID
ISXB-697
Regression
No
Left Mouse Button is recognized as pressed in the Editor when it's released after alt-tabbing from a different window to the Editor
Reproduction steps:
1. Open the attached “My project.zip” project
2. Enter Play Mode
3. Click the left mouse button and notice that the text in the Game window changes to “… KeyBoardMouse Left Mouse Performed:System.Single, (1.00, 0.00, 0.00)” when the left mouse button is clicked and to “… KeyBoardMouse Left Mouse Cancelled:System.Single, (0.00, 0.00, 0.00)” when it’s released
4. Open File Explorer or any other window
5. Click on it with the left mouse button, Press Alt+tab to switch to the Editor window and release the left mouse button
6. Observe the text on the Game window
Expected result: “… KeyBoardMouse Left Mouse Cancelled:System.Single, (0.00, 0.00, 0.00)” is displayed
Actual result: “… KeyBoardMouse Left Mouse Performed:System.Single, (1.00, 0.00, 0.00)” is displayed
Reproducible with: 1.6.1 (2021.3.33f1, 2022.3.15f1, 2023.2.3f1, 2023.3.0a17), 1.8.0-pre.2 (2023.3.0a17)
Reproduced on: Windows 11 Pro
Not reproduced on: macOS Sonoma 14.1.1 (Intel)
UPDATE:
This bug is caused by a complicated interaction with the InputSystem's "device sync" (for the mouse) and the Windows input messages, specifically WM_LBUTTONDOWN and WM_LBUTTONUP.
When the Unity app receives focus, e.g. Alt+Tab to the Editor, InputSystem "synchronizes" the device state by directly polling the position and button state from Windows. However, since the mouse button was pressed in a different window, the WM_LBUTTONUP message isn't dispatched to Unity but instead (typically) goes to the window that originally received the WM_LBUTTONDOWN message. This means Unity "misses" the button-up event causing the Action to get stuck in the Performed state.
This issue occurs both for the Editor and Windows Player.
Unfortunately, there isn't a straight-forward fix as it's somewhat of a flaw with the Windows input back-end implementation. Fixing this bug would require significant changes to the native back-end, which is not only risky but would alter well-established behavior. Although this issue can be a nuisance for development workflows, it is a minor corner-case that doesn't significantly impact the end-user (actual shipping games).
Therefore we won't be fixing this issue at this time.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- "Draw Additional Lights Shadowmap" calls increase when custom MaterialBlockProperty is used
- Crash on _platform_memmove when importing the "Dragon Crashers - URP 2D Sample Project" to a new 2D project
- "Shader is not supported on this GPU" warnings and and shaders are not loading when building the project for non-Chromium browsers
- [iOS][URP] The screen flickers and the "Execution of the command buffer was aborted due to an error during execution" error is thrown continuously
- Shortcut Manager shows empty conflict filter when resolving runtime conflicts involving different contexts
Resolution Note:
There are no fixes planned for this Bug