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
- Foldout arrow indent is misaligned in the Inspector when used for Arrays or Lists
- Material import pipeline strips properties when it is added with a script
- 'Shader warning in 'Hidden/HDRP/DebugFullScreen': HLSLcc: Large chunk of constant data detected' after building HDRP project
- [Android] An app reload is required to fill the whole Viewport when unfolding a Pixel Fold device with the Allowed-Orientations set to only Landscape
- [OpenGL][PowerVR] The screen behind the Canvas is rendered white when an Overlay Camera is rendering the Canvas in the Player
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).