Browse Source

Backends: SDL: Fixed mapping for ImGuiKey_KeyPadEnter. (#3031) [@Davido71]

pull/3041/head
ocornut 5 years ago
parent
commit
0345324646
  1. 1
      docs/CHANGELOG.txt
  2. 3
      examples/imgui_impl_sdl.cpp

1
docs/CHANGELOG.txt

@ -54,6 +54,7 @@ Other Changes:
a manifest.
- Backends: SDL: Added ImGui_ImplSDL2_InitForMetal() for API consistency (even though the function
currently does nothing).
- Backends: SDL: Fixed mapping for ImGuiKey_KeyPadEnter. (#3031) [@Davido71]
- Examples: Added SDL2+Metal example application. (#3017) [@coding-jackalope]

3
examples/imgui_impl_sdl.cpp

@ -17,6 +17,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2020-02-20: Inputs: Fixed mapping for ImGuiKey_KeyPadEnter (using SDL_SCANCODE_KP_ENTER instead of SDL_SCANCODE_RETURN2).
// 2019-12-17: Inputs: On Wayland, use SDL_GetMouseState (because there is no global mouse state).
// 2019-12-05: Inputs: Added support for ImGuiMouseCursor_NotAllowed mouse cursor.
// 2019-07-21: Inputs: Added mapping for ImGuiKey_KeyPadEnter.
@ -152,7 +153,7 @@ static bool ImGui_ImplSDL2_Init(SDL_Window* window)
io.KeyMap[ImGuiKey_Space] = SDL_SCANCODE_SPACE;
io.KeyMap[ImGuiKey_Enter] = SDL_SCANCODE_RETURN;
io.KeyMap[ImGuiKey_Escape] = SDL_SCANCODE_ESCAPE;
io.KeyMap[ImGuiKey_KeyPadEnter] = SDL_SCANCODE_RETURN2;
io.KeyMap[ImGuiKey_KeyPadEnter] = SDL_SCANCODE_KP_ENTER;
io.KeyMap[ImGuiKey_A] = SDL_SCANCODE_A;
io.KeyMap[ImGuiKey_C] = SDL_SCANCODE_C;
io.KeyMap[ImGuiKey_V] = SDL_SCANCODE_V;

Loading…
Cancel
Save