Skip to content

sim/keyboard: Translate X11 key codes to NuttX codec#18949

Merged
acassis merged 1 commit into
apache:masterfrom
linguini1:fix-sim-keyboard
May 24, 2026
Merged

sim/keyboard: Translate X11 key codes to NuttX codec#18949
acassis merged 1 commit into
apache:masterfrom
linguini1:fix-sim-keyboard

Conversation

@linguini1
Copy link
Copy Markdown
Contributor

@linguini1 linguini1 commented May 24, 2026

Summary

The previous implementation just passed X11 key codes to the NuttX keyboard driver, which only really worked correctly for the letter keys. Now, special keys are translated into the NuttX codec (like Enter, arrow keys, etc.) so that they can be used properly by NuttX applications relying on keyboard input.

Tangentially related to GSoC #18507, the milestone including user applications like DOOM.

Impact

Keyboard device on the Simulator works like expected now.

Testing

Tested while porting DOOM (https://github.com/linguini1/NXDoom) and adding
keyboard input.

Before: Keys like Enter had codes like 65307, and my switch case using the
NuttX key coded could not handle this.

After:
Enter appears as KEYCODE_ENTER and my input to DOOM works as expected. Here's
a screenshot of the game play:

image

Question:

Does anyone know if the NuttX keyboard codec has support for the ESCAPE key, or if I can add it? Right now there's no way for me to exit the menus in DOOM once I'm in them :)

Also, is there a rationale for not having things like shift, left and right control, etc. represented?

@linguini1 linguini1 requested a review from jerpelea as a code owner May 24, 2026 17:36
@github-actions github-actions Bot added Arch: simulator Issues related to the SIMulator Size: M The size of the change in this PR is medium labels May 24, 2026
The previous implementation just passed X11 key codes to the NuttX
keyboard driver, which only really worked correctly for the letter keys.
Now, special keys are translated into the NuttX codec (like Enter, arrow
keys, etc.) so that they can be used properly by NuttX applications
relying on keyboard input.

Signed-off-by: Matteo Golin <matteo.golin@gmail.com>
@acassis acassis merged commit 94f3db6 into apache:master May 24, 2026
15 checks passed
@linguini1 linguini1 deleted the fix-sim-keyboard branch May 24, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: simulator Issues related to the SIMulator Size: M The size of the change in this PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants