Repository: ocornut/imgui (language: rust)

Issue:
Latest SDL3 API removed keysym field in SDL_Keyboardevent
### Version/Branch of Dear ImGui:

Version 1.90.8, Branch: master

### Back-ends:

imgui_impl_sdl3.cpp

### Compiler, OS:

Windows 10 + MSYS clang++

### Full config/build information:

_No response_

### Details:

The API of SDL3 updated again to remove the keysym field from SDL_KeyboardEvent, as noted here: https://github.com/libsdl-org/SDL/blob/main/docs/README-migration.md#sdl_eventsh

This breaks the sdl3 backend.


### Screenshots/Video:

_No response_

### Minimal, Complete and Verifiable Example code:

```cpp
#include <imgui_impl_sdl3.h>
```


Discussion / hints:

Fix patch:
diff --git a/backends/imgui_impl_sdl3.cpp b/backends/imgui_impl_sdl3.cpp
index 3da22f9b589a..8b210b223e3a 100644
--- a/backends/imgui_impl_sdl3.cpp
+++ b/backends/imgui_impl_sdl3.cpp
@@ -326,10 +326,10 @@ bool ImGui_ImplSDL3_ProcessEvent(const SDL_Event* event)
         case SDL_EVENT_KEY_DOWN:
         case SDL_EVENT_KEY_UP:
         {
-            ImGui_ImplSDL3_UpdateKeyModifiers((SDL_Keymod)event->key.keysym.mod);
-            ImGuiKey key = ImGui_ImplSDL3_KeycodeToImGuiKey(event->key.keysym.sym);
+            ImGui_ImplSDL3_UpdateKeyModifiers((SDL_Keymod)event->key.mod);
+            ImGuiKey key = ImGui_ImplSDL3_KeycodeToImGuiKey(event->key.key);
             io.AddKeyEvent(key, (event->type == SDL_EVENT_KEY_DOWN));
-            io.SetKeyEventNativeData(key, event->key.keysym.sym, event->key.keysym.scancode, event->key.keysym.scancode); // To support legacy indexing (<1.87 user code). Legacy backend uses SDLK_*** as indices to IsKeyXXX() functions.
+            io.SetKeyEventNativeData(key, event->key.key, event->key.scancode, event->key.scancode); // To support legacy indexing (<1.87 user code). Legacy backend uses SDLK_*** as indices to IsKeyXXX() functions.
             return true;
         }
         case SDL_EVENT_WINDOW_MOUSE_ENTER:
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index 5170ea6b3cc6..35694f47e2ec 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -83,6 +83,7 @@ Other changes:
 - Examples: GLFW+Vulkan, SDL+Vulkan: handle swap chain resize even without Vulkan
   returning VK_SUBOPTIMAL_KHR, which doesn't seem to happen on Wayland. (#7671)
   [@AndreiNego, @ocornut]
+- Backends: SDL3: Update for API removal of keysym field in SDL_KeyboardEvent. (#7728)
 
 
 -----------------------------------------------------------------------


Test patch: