Reproduction steps:
1. Open the attached “MouseButtons” project
2. Open the “SampleScene” scene
3. Enter Play Mode
4. Press the left and right mouse buttons
5. Move the cursor outside the Game view
6. Release the right mouse button
7. Release the left mouse button
8. Observe the Console
Expected result: “KeyUp: Mouse0” is logged
Actual result: “KeyUp: Mouse0” is not logged
Reproduced in: 2020.3.36f1, 2021.3.5f1, 2022.1.8f1, 2022.2.0a18, 2023.1.0a2
Reproduced using: Windows 10, Windows 11
Not reproduced using: macOS 13.4 (Intel)
Notes:
1. The reporter also reproduced in WebGL
2. Not reproduced in Windows Player
3. Not reproduced with keyboard keys
4. Also reproduced with the right mouse button
5. KeyDown isn’t called when pressing the left mouse button in Game view for the first time after reproduction (Unity thinks it’s still pressed even though physically it’s not)
6. OnApplicationFocus and OnApplicationPause do not return true during reproduction, indicating that the Game view does not lose focus