I'm learning more about how SDL translates key events in wayland.
Under Ubuntu 24.04.3 with wayland:
$ grep -rni xfree86_scancode_table2 ~/Downloads/libsdl2_2.30.0+dfsg.orig
libsdl2_2.30.0+dfsg.orig/SDL2-2.30.0/src/events/scancodes_xfree86.h:183:static const SDL_Scancode xfree86_scancode_table2[] = {
$ grep -rni SDL_GetScancodeFromTable ~/Downloads/libsdl2_2.30.0+dfsg.orig
libsdl2_2.30.0+dfsg.orig/SDL2-2.30.0/src/events/SDL_keysym_to_scancode.c:435: return SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_LINUX, linux_keycode);
libsdl2_2.30.0+dfsg.orig/SDL2-2.30.0/src/video/wayland/SDL_waylandevents.c:934: scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_XFREE86_2, (key - 8));
libsdl2_2.30.0+dfsg.orig/SDL2-2.30.0/src/video/wayland/SDL_waylandevents.c:1087: scancode = SDL_GetScancodeFromTable(SDL_SCANCODE_TABLE_XFREE86_2, key - 8);
Apparently, the scancode table for wayland is in src/events/scancodes_xfree86.h
According to the file it says it's pretty much the same as the regular linux input event codes.
// This is largely identical to the Linux keycode mapping
I also looked at the SDL scancodes available in
/usr/include/SDL2/SDL_scancode.h
/**
* \name Usage page 0x0C (additional media keys)
*
* These values are mapped from usage page 0x0C (USB consumer page).
*/
/* @{ */
SDL_SCANCODE_AUDIOREWIND = 285,
SDL_SCANCODE_AUDIOFASTFORWARD = 286,
so after adding a line to src/osd/modules/input/input_common.cpp
now I can use the KEY_REWIND with my uinjput key event generator.