hashlink icon indicating copy to clipboard operation
hashlink copied to clipboard

[Sdl] add keycode, keymod and scancode constants

Open zagortenej opened this issue 4 months ago • 0 comments

This PR adds following SDL enums as Haxe constants:

  • https://wiki.libsdl.org/SDL2/SDL_KeyCode
  • https://wiki.libsdl.org/SDL2/SDL_Keymod
  • https://wiki.libsdl.org/SDL2/SDL_Scancode

The KeyCode and Keymod constants source code is generated from a C program using code lines like this one:

  printf("  var KMOD_CTRL = %d;\n", KMOD_CTRL);

which ensures that numerical values in the Haxe source are actual C macro values.

The Scancode source is generated by simple find/replace operation, since all enums in SDL source have literal numerical values.

zagortenej avatar Sep 06 '25 22:09 zagortenej