Volume keys not recognized?

Hello,

I’m testing a SDL application on OpenBSD and I’ve noticed some “key pressed is not recognized” messages when I use volume keys:

X11 KeyCode 174 (166), X11 KeySym 0x1008FF11 (XF86AudioLowerVolume)
X11 KeyCode 176 (168), X11 KeySym 0x1008FF13 (XF86AudioRaiseVolume)

Looks like these should be mapped to VOLUMEDOWN / VOLUMEUP. I’ve looked around src/events and haven’t found any constant as high as those in the messages… is this an issue?

I’m able to build SDL and tinker with it and will be playing around trying to get these mapped, but any pointers would be appreciated.

Thanks,
Francisco

OK, looks like this fixes it. I’ve added additional mappings for volume keys:

diff -ru SDL2-2.0.14/src/events/scancodes_xfree86.h /tmp/SDL2-2.0.14-fixed/src/events/scancodes_xfree86.h
--- SDL2-2.0.14/src/events/scancodes_xfree86.h	Mon Dec 21 14:44:36 2020
+++ /tmp/SDL2-2.0.14-fixed/src/events/scancodes_xfree86.h	Mon Mar  1 14:43:41 2021
@@ -177,6 +177,28 @@
     /*  144 */  SDL_SCANCODE_PASTE,
     /*  145 */  SDL_SCANCODE_FIND,
     /*  146 */  SDL_SCANCODE_CUT,
+    /*  147 */  SDL_SCANCODE_UNKNOWN,
+    /*  148 */  SDL_SCANCODE_UNKNOWN,
+    /*  149 */  SDL_SCANCODE_UNKNOWN,
+    /*  150 */  SDL_SCANCODE_UNKNOWN,
+    /*  151 */  SDL_SCANCODE_UNKNOWN,
+    /*  152 */  SDL_SCANCODE_MUTE,
+    /*  153 */  SDL_SCANCODE_UNKNOWN,
+    /*  154 */  SDL_SCANCODE_UNKNOWN,
+    /*  155 */  SDL_SCANCODE_UNKNOWN,
+    /*  156 */  SDL_SCANCODE_UNKNOWN,
+    /*  157 */  SDL_SCANCODE_UNKNOWN,
+    /*  158 */  SDL_SCANCODE_UNKNOWN,
+    /*  159 */  SDL_SCANCODE_UNKNOWN,
+    /*  160 */  SDL_SCANCODE_UNKNOWN,
+    /*  161 */  SDL_SCANCODE_UNKNOWN,
+    /*  162 */  SDL_SCANCODE_UNKNOWN,
+    /*  163 */  SDL_SCANCODE_UNKNOWN,
+    /*  164 */  SDL_SCANCODE_UNKNOWN,
+    /*  165 */  SDL_SCANCODE_UNKNOWN,
+    /*  166 */  SDL_SCANCODE_VOLUMEDOWN,
+    /*  167 */  SDL_SCANCODE_UNKNOWN,
+    /*  168 */  SDL_SCANCODE_VOLUMEUP,
 };
 
 /* for wireless usb keyboard (manufacturer TRUST) without numpad. */

Previous mappings:

/*  133 */  SDL_SCANCODE_MUTE,
/*  134 */  SDL_SCANCODE_VOLUMEDOWN,
/*  135 */  SDL_SCANCODE_VOLUMEUP,

I’m not sure how machine-specific this is, or how generic this xfree86 table should be.

Any feedback is appreciated!