Skip to content

Keyboard layout support.

Golden requested to merge Golden/SRB2:text-input into next

Uses SDL_Keycode to implement basic keyboard layout support, specifically for text fields.

Console variables:

  • kb_ignorelayout (default Off), CV_SAVE: Turn on to disable keyboard layout support.

C:

  • event_t has one new field:
    • INT32realkey (after key): The key, generated from SDL_Keycode instead of SDL_Scancode -- what key uses.
      When the event_t is not generated from a SDL_KeyboardEvent, equals key.

Lua:

  • keyevent_t userdata sent by the KeyDown and KeyUp hooks has 2 new fields.
    The original fields name and num remain, and retain their behavior of assuming you're using the QWERTY layout.
    • stringrealname: The name of the key according to the current keyboard layout.
    • intrealnum: The numeric code of the key according to the current keyboard layout.

Merge request reports