Search Issue Tracker
Won't Fix
Votes
1
Found in [Package]
1.0.1
Issue ID
1303619
Regression
No
Keyboard input is not processed when using the InputSystem and Player is hosted in a WPF application
Reproduction steps:
1. Open the user's attached file
2. Navigate to keyboardControlsInsideWpf/bin and launch UnityShellTest.exe
3. On the left side of a window, select New
4. Use arrow keys to move around
Expected result: The Camera is moving
Actual result: The Camera is not moving
Reproducible with: 1.0.0-preview.1 - 1.0.1 (2019.4.18f1, 2020.2.2f1, 2021.1.0b2)
Not reproducible with: 2018.4.30f1 (could not downgrade InputSystem package)
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
- Crash on RaiseException when opening a specific project
- DownloadHandlerScript.CompleteContent is called twice when building for WebGL
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
Resolution Note:
On Windows, raw input (https://docs.microsoft.com/en-us/windows/win32/inputdev/about-raw-input) messages for keyboard do not propagate to child windows if they're hosted in a different process. Since the new input system uses raw input for keyboard input. it receives no keyboard input when hosted inside another process.
As a workaround, you can call RegisterRawInputDevices (https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerrawinputdevices) to register your WPF app HwndHost to receive keyboard RawInput, and then forward the WM_INPUT messages you receive in the WndProc to the hosted Unity process via SendMessageW (https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-sendmessagew).