mojira.dev

Gabriele Craviotto

Assigned

No issues.

Reported

No issues.

Comments

I accidentally posted my previous comment before I had finished writing it. Continuing here:

  • 0 works as digit 0

  • Enter behaves as 1

  • Escape behaves as 2

  • Backspace behaves as 3

  • Tab behaves as 4

  • Space behaves as 5

  • - behaves as 6

  • = behaves as 7

  • [ behaves as 8

  • ] behaves as 9

This can be verified from the official documentation:

I investigated this further and found that the incorrect mappings are not random. They appear to be caused by the migration from GLFW key tokens to SDL3 scancodes in Snapshot 4.

Before the migration, InputWithModifiers.input() used GLFW key tokens, where the digit keys (GLFW_KEY_0–GLFW_KEY_9) are consecutive values. This made it valid to derive the digit by subtracting the value of GLFW_KEY_0.

After the migration, InputWithModifiers.input() uses SDL3 scancodes, which represent physical key positions instead. Since SDL orders the number row as SDL_SCANCODE_1–SDL_SCANCODE_9, followed by SDL_SCANCODE_0, the same approach no longer works and the subsequent scancodes are interpreted as digits, matching the observed behavior: