diff options
Diffstat (limited to 'src/platforms/rcore_desktop_sdl.c')
| -rw-r--r-- | src/platforms/rcore_desktop_sdl.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index a274f25d..e684465c 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1110,6 +1110,25 @@ void PollInputEvents(void) if (key != KEY_NULL) CORE.Input.Keyboard.currentKeyState[key] = 0; } break; + case SDL_TEXTINPUT: + { + // Check if there is space available in the key queue + if (CORE.Input.Keyboard.keyPressedQueueCount < MAX_KEY_PRESSED_QUEUE) + { + // Add character to the queue + CORE.Input.Keyboard.keyPressedQueue[CORE.Input.Keyboard.keyPressedQueueCount] = event.text.text[0]; + CORE.Input.Keyboard.keyPressedQueueCount++; + } + + // Check if there is space available in the queue + if (CORE.Input.Keyboard.charPressedQueueCount < MAX_CHAR_PRESSED_QUEUE) + { + // Add character to the queue + CORE.Input.Keyboard.charPressedQueue[CORE.Input.Keyboard.charPressedQueueCount] = event.text.text[0]; + CORE.Input.Keyboard.charPressedQueueCount++; + } + } break; + // Check mouse events case SDL_MOUSEBUTTONDOWN: { |
