Skip to content

Instantly share code, notes, and snippets.

View blep's full-sized avatar

Baptiste Lepilleur blep

View GitHub Profile
@blep
blep / imgui_impl_sdl.cpp
Created March 23, 2020 12:06
DearImGi : change to automatically adapt to keyboard layout with SDL (handling both qwerty/azerty)
// The ideas:
// - Initialize varying key to SDL_SCANCODE_UNKNOWN
// - On KeyPress, retrieve the actual ASCII code corresponding to the letter, and map related input
static void ImGui_ImplSDL2_SetScancodeFromLetter(ImGuiIO& io, int scanCode, int ascii)
{
switch (ascii)
{
case 'a': case 'A':
io.KeyMap[ImGuiKey_A] = scanCode;