mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-01 19:44:40 +00:00
Removed raw key events
They weren't adding any value over the existing keyboard events
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user