[Bug]: Keyboard input injection does not work in games
- Dominant language
- TypeScript
- Stars
- 38
- Forks
- 78
- Avg merge
- 4d 4h
- Merged PRs (30d)
- 7
Description
### Bug Description
Keyboard input injected through the client works correctly for regular text input and browser-based applications, controls are not recognized by games. The current implementation uses KEYEVENTF_UNICODE with the character code as wScan. This appears to provide text input rather than the physical/scancode keyboard events expected by many games.
As a result, keys such as W, A, S, and D cannot reliably be used for movement in games through Rein's remote keyboard input.
### Steps to Reproduce
1. Start the Rein server and connect using the client.
2. Open a game that uses WASD for movement.
3. Use the client's keyboard input to send W, A, S, or D.
4. Observe that the game does not respond to the injected keys.
5. Test the same input in a browser or text field and observe that the characters are entered correctly.
### Expected Behavior
Injected keyboard input should be recognized by games as actual keyboard key-down and key-up events.
### Desktop Operating System
Windows 11
### Client OS and browser
Brave
### Rein Version
0.5.0
### Console Logs / Error Messages (Optional)
```shell
nil
```
### Screenshots / Recordings (Optional)
nil
### Checklist
- [x] I have searched for existing issues to avoid duplicates
Contributor guide
Research direction
Start by locating the keyboard injection implementation that uses KEYEVENTF_UNICODE and trace how client key-down and key-up events reach the Windows input layer. Compare the existing behavior in browser text fields with game input, then verify that WASD events are recognized as physical keyboard events in a Windows 11 game.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100