Resolving SDL Keycodes to Windows Keycodes


I am using FreeRDP. I try to take scancodes as reported by SDL2

From the FreeRDP source it seems that the “scancodes” may actually be
the virtual key constants:

Is anyone aware of a way to resolve SDL2 keys to the ones FreeRDP and
I Windows uses?

E.g. “,” turns into “z”, see:

physical: M; scancode: 16, keysym: 109
physical: ,; scancode: 54, keysym: 44
physical: C; scancode: 6, keysym: 99
physical: Z; scancode: 29, keysym: 122
physical: .; scancode: 55, keysym: 46

printf("physical: %s; scancode: %d, keysym: %d\n",


In case those are scancodes after all (and the values seem to match the DIK_* scancodes from DirectInput), I’ve got a table that matches SDL scancodes to those DIK scancodes: