We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4814

Summary: Missing scancodes on Linux
Product: SDL Reporter: Michael Roe <mroe1492>
Component: eventsAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Linux   

Description Michael Roe 2019-10-04 21:13:15 UTC
The mappings for keyboard scancodes on Linux do not include keypad left and right parentheses (used on some Microsoft keyboard), keypad plus/minus, LANG1 and LANG2 (used on Korean keyboards), XK86MenuKB, and F20 (remapped to Audio Mic Mute in the usual X11 config).

Here's a patch to fix it.



---
 src/events/scancodes_xfree86.h | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/events/scancodes_xfree86.h b/src/events/scancodes_xfree86.h
index ad10f31d6..c50bae7d5 100644
--- a/src/events/scancodes_xfree86.h
+++ b/src/events/scancodes_xfree86.h
@@ -299,12 +299,12 @@ static const SDL_Scancode xfree86_scancode_table2[] = {
     /* 115 */   SDL_SCANCODE_VOLUMEUP,
     /* 116 */   SDL_SCANCODE_POWER,
     /* 117 */   SDL_SCANCODE_KP_EQUALS,
-    /* 118 */   SDL_SCANCODE_UNKNOWN,   /* plusminus */
+    /* 118 */   SDL_SCANCODE_KP_PLUSMINUS, /* plusminus */
     /* 119 */   SDL_SCANCODE_PAUSE,
     /* 120 */   SDL_SCANCODE_UNKNOWN,   /* XF86LaunchA */
-    /* 121 */   SDL_SCANCODE_UNKNOWN,   /* KP_Decimal */
-    /* 122 */   SDL_SCANCODE_UNKNOWN,   /* Hangul */
-    /* 123 */   SDL_SCANCODE_UNKNOWN,   /* Hangul_Hanja */
+    /* 121 */   SDL_SCANCODE_KP_COMMA,  /* KP_Decimal */
+    /* 122 */   SDL_SCANCODE_LANG1,     /* Hangul */
+    /* 123 */   SDL_SCANCODE_LANG2,     /* Hangul_Hanja */
     /* 124 */   SDL_SCANCODE_INTERNATIONAL3, /* Yen */
     /* 125 */   SDL_SCANCODE_LGUI,
     /* 126 */   SDL_SCANCODE_RGUI,
@@ -320,7 +320,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = {
     /* 136 */   SDL_SCANCODE_FIND,
     /* 137 */   SDL_SCANCODE_CUT,
     /* 138 */   SDL_SCANCODE_HELP,
-    /* 139 */   SDL_SCANCODE_UNKNOWN,   /* XF86MenuKB */
+    /* 139 */   SDL_SCANCODE_MENU,   /* XF86MenuKB */
     /* 140 */   SDL_SCANCODE_CALCULATOR,
     /* 141 */   SDL_SCANCODE_UNKNOWN,
     /* 142 */   SDL_SCANCODE_SLEEP,
@@ -360,8 +360,8 @@ static const SDL_Scancode xfree86_scancode_table2[] = {
     /* 176 */   SDL_SCANCODE_UNKNOWN,
     /* 177 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollUp */
     /* 178 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollDown */
-    /* 179 */   SDL_SCANCODE_UNKNOWN,   /* parenleft */
-    /* 180 */   SDL_SCANCODE_UNKNOWN,   /* parenright */
+    /* 179 */   SDL_SCANCODE_KP_LEFTPAREN,  /* parenleft */
+    /* 180 */   SDL_SCANCODE_KP_RIGHTPAREN, /* parenright */
     /* 181 */   SDL_SCANCODE_UNKNOWN,   /* XF86New */
     /* 182 */   SDL_SCANCODE_AGAIN,
     /* 183 */   SDL_SCANCODE_F13,       /* XF86Tools */
@@ -371,7 +371,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = {
     /* 187 */   SDL_SCANCODE_F17,       /* XF86Launch8 */
     /* 188 */   SDL_SCANCODE_F18,       /* XF86Launch9 */
     /* 189 */   SDL_SCANCODE_F19,       /* null keysym */
-    /* 190 */   SDL_SCANCODE_UNKNOWN,
+    /* 190 */   SDL_SCANCODE_F20,
     /* 191 */   SDL_SCANCODE_UNKNOWN,
     /* 192 */   SDL_SCANCODE_UNKNOWN,   /* XF86TouchpadToggle */
     /* 193 */   SDL_SCANCODE_UNKNOWN,
@@ -389,7 +389,7 @@ static const SDL_Scancode xfree86_scancode_table2[] = {
     /* 205 */   SDL_SCANCODE_UNKNOWN,   /* XF86Suspend */
     /* 206 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
     /* 207 */   SDL_SCANCODE_AUDIOPLAY,
-    /* 208 */   SDL_SCANCODE_AUDIONEXT,
+    /* 208 */   SDL_SCANCODE_AUDIOFASTFORWARD,
     /* 209 */   SDL_SCANCODE_UNKNOWN,
     /* 210 */   SDL_SCANCODE_PRINTSCREEN,
     /* 211 */   SDL_SCANCODE_UNKNOWN,
-- 
2.17.1
Comment 1 Sam Lantinga 2019-11-17 06:46:12 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/900d20d46990