Search Issue Tracker
By Design
Votes
0
Found in [Package]
1.11.2
Issue ID
ISXB-1196
Regression
No
Key state misreported for ~1 second when refocusing on Game view while using Input System
How to reproduce:
1. Open the attached "IN-88227" project
2. Open the "SampleScene" and enter Play mode
3. Click any window outside the Game window in the Editor to put the window out of focus
4. Refocus on the Game window while holding the Alt key and by clicking with the left mouse button simultaneously
5. Observe the Game window
Expected result: Input is detected immediately
Actual result: There’s a delay in the detection of the input
Reproducible in: 1.7.0 (2021.3.46f1, 2022.3.47f1), 1.11.2 (2021.3.46f1, 2022.3.47f1, 6000.0.27f1, 6000.1.0a4)
Reproducible on: Windows 11
Not reproducible on: macOS 14.6.1 (M1 Pro)
Notes:
- Also reproducible in Player
- Alt key needs to be pressed immediately while re-focusing the Game window, otherwise if there is a delay between pressing Alt and the Left Mouse Button the input detection delay is inconsistent and at times unobservable
- Discussions forum thread regarding this issue - https://discussions.unity.com/t/key-state-is-misreported-for-1s-when-going-from-unitys-editor-ui-to-focusing-the-game-view/1547742
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
- Channel remapping dropdown in the Terrain Layer does not open when clicked on the title
- The Editor freezes indefinitely when a large number of elements are entered in the Subgraphs or Categories lists
- Some Visual Effects package Assets links to documentation are not working
- Heatmap asset’s documentation button in the Inspector window leads to “Sorry... that page seems to be missing!” page when clicked
- Crash on MonoBehaviour::CallMethodIfAvailable when performing various actions
Resolution Note:
Closing as there is a workaround to give the desired behaviour in the Editor as discussed in the Discsussion's thread:
https://discussions.unity.com/t/key-state-is-misreported-for-1s-when-going-from-unitys-editor-ui-to-focusing-the-game-view/1547742/5
"If you apply these:
Set Player Settings / Resolution and Presentation / Run In Background to: ON
Set Input System Package / Settings / Background Behavior to: Ignore Focus
Set Input System Package / Settings / Play Mode Input Behavior to: All Device Input Always Goes To Game View
This leads to these two working as you expect:
Keyboard.current.leftAltKey.ReadUnprocessedValue()
action.action.IsPressed()"