Revert "Change SDL_Keycode type to an enum"

SDL_Keycode can actually be any printable character on the keyboard, so isn't limited to the enumerated values of SDL_KeyCode.
This commit is contained in:
Sam Lantinga 2024-03-07 06:30:51 -08:00
parent 33eaddc565
commit e9ab2d46de
3 changed files with 19 additions and 18 deletions

View file

@ -31,9 +31,6 @@
#include <SDL3/SDL_stdinc.h>
#include <SDL3/SDL_scancode.h>
#define SDLK_SCANCODE_MASK (1<<30)
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
/**
* The SDL virtual key representation.
*
@ -45,6 +42,10 @@
* A special exception is the number keys at the top of the keyboard which
* map to SDLK_0...SDLK_9 on AZERTY layouts.
*/
typedef Sint32 SDL_Keycode;
#define SDLK_SCANCODE_MASK (1<<30)
#define SDL_SCANCODE_TO_KEYCODE(X) (X | SDLK_SCANCODE_MASK)
typedef enum
{
@ -323,7 +324,7 @@ typedef enum
SDLK_SOFTRIGHT = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_SOFTRIGHT),
SDLK_CALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_CALL),
SDLK_ENDCALL = SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_ENDCALL)
} SDL_Keycode;
} SDL_KeyCode;
/**
* Enumeration of valid key mods (possibly OR'd together).