Removed raw key events

They weren't adding any value over the existing keyboard events
This commit is contained in:
Sam Lantinga
2024-12-21 04:46:37 -08:00
parent c44fa5bb07
commit d07bb0e679
12 changed files with 4 additions and 78 deletions

View File

@@ -62,8 +62,6 @@ SDL_EventCategory SDL_GetEventCategory(Uint32 type)
case SDL_EVENT_KEY_DOWN:
case SDL_EVENT_KEY_UP:
case SDL_EVENT_RAW_KEY_DOWN:
case SDL_EVENT_RAW_KEY_UP:
return SDL_EVENTCATEGORY_KEY;
case SDL_EVENT_TEXT_EDITING:

View File

@@ -535,19 +535,6 @@ static void SDL_LogEvent(const SDL_Event *event)
break;
#undef PRINT_KEY_EVENT
#define PRINT_RAW_KEY_EVENT(event) \
(void)SDL_snprintf(details, sizeof(details), " (timestamp=%u which=%u state=%s scancode=%u)", \
(uint)event->raw_key.timestamp, (uint)event->raw_key.which, \
event->raw_key.down ? "pressed" : "released", \
(uint)event->raw_key.scancode);
SDL_EVENT_CASE(SDL_EVENT_RAW_KEY_DOWN)
PRINT_RAW_KEY_EVENT(event);
break;
SDL_EVENT_CASE(SDL_EVENT_RAW_KEY_UP)
PRINT_RAW_KEY_EVENT(event);
break;
#undef PRINT_RAW_KEY_EVENT
SDL_EVENT_CASE(SDL_EVENT_TEXT_EDITING)
(void)SDL_snprintf(details, sizeof(details), " (timestamp=%u windowid=%u text='%s' start=%d length=%d)",
(uint)event->edit.timestamp, (uint)event->edit.windowID,

View File

@@ -690,22 +690,6 @@ bool SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scancode)
return SDL_SendKeyboardKeyInternal(timestamp, KEYBOARD_AUTORELEASE, SDL_GLOBAL_KEYBOARD_ID, 0, scancode, true);
}
void SDL_SendRawKeyboardKey(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, bool down)
{
const SDL_EventType type = down ? SDL_EVENT_RAW_KEY_DOWN : SDL_EVENT_RAW_KEY_UP;
if (SDL_EventEnabled(type)) {
SDL_Event event;
event.type = type;
event.common.timestamp = timestamp;
event.raw_key.which = keyboardID;
event.raw_key.scancode = scancode;
event.raw_key.raw = rawcode;
event.raw_key.down = down;
SDL_PushEvent(&event);
}
}
void SDL_ReleaseAutoReleaseKeys(void)
{
SDL_Keyboard *keyboard = &SDL_keyboard;

View File

@@ -63,9 +63,6 @@ extern bool SDL_SendKeyboardKeyAutoRelease(Uint64 timestamp, SDL_Scancode scanco
Most platforms should prefer to optionally call SDL_SetKeymap and then use SDL_SendKeyboardKey. */
extern bool SDL_SendKeyboardKeyAndKeycode(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, SDL_Keycode keycode, bool down);
// Send a raw keyboard key event
extern void SDL_SendRawKeyboardKey(Uint64 timestamp, SDL_KeyboardID keyboardID, int rawcode, SDL_Scancode scancode, bool down);
// Release all the autorelease keys
extern void SDL_ReleaseAutoReleaseKeys(void);