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
- NavMesh Surface is baked too high above the ground, making the NavMesh Agents hover above the ground when the HeightMesh is not built
- [Android] Crash on ProcessDynamicBatchGeometryJob with OpenGL or on DrawSharedGeometryJobs with Vulkan
- VFX Graph Memory leak when calling the ClearPropertyBinders and AddRemoveVFXProperty
- Entering "Configure Avatar" inside the Inspector locks it
- [Render Graph Viewer] Resource list icons cropped and in inconsistent positions
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).