hashlink
hashlink copied to clipboard
[Sdl] add keycode, keymod and scancode constants
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.