R0b0t1
1
Hello,
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",
SDL_GetScancodeName(event.key.keysym.scancode),
event.key.keysym.scancode,
SDL_GetKeyFromScancode(event.key.keysym.scancode)
);
Cheers,
R0b0t1
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: https://github.com/DanielGibson/Snippets/blob/master/sdl2_scancode_to_dinput.h