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 4164 - Missing X11 scancode mappings for numeric keypad
Summary: Missing X11 scancode mappings for numeric keypad
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: 2.0.8
Hardware: x86_64 Linux
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-11 18:51 UTC by Michael Roe
Modified: 2018-05-11 18:51 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Roe 2018-05-11 18:51:48 UTC
The mapping from X11 scancodes to SDL scancodes in events/scancodes_xfree86.h is missing entries for the additional keys found on some numeric keypads, such as the Microsoft Natural 4000. The effect of this bug is that these keys won't work in SDL2 applications.

Here's a patch to fix the issue. (The patch also fixes another bug, that the scancode for the Fast Forward key was wrong).

*** scancodes_xfree86.h.old     2018-05-11 19:44:28.646047000 +0100
--- scancodes_xfree86.h 2018-05-11 19:45:08.830265000 +0100
***************
*** 298,304 ****
      /* 118 */   SDL_SCANCODE_UNKNOWN,   /* 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 */
      /* 124 */   SDL_SCANCODE_INTERNATIONAL3, /* Yen */
--- 298,304 ----
      /* 118 */   SDL_SCANCODE_UNKNOWN,   /* plusminus */
      /* 119 */   SDL_SCANCODE_PAUSE,
      /* 120 */   SDL_SCANCODE_UNKNOWN,   /* XF86LaunchA */
!     /* 121 */   SDL_SCANCODE_KP_COMMA,        /* KP_Decimal */
      /* 122 */   SDL_SCANCODE_UNKNOWN,   /* Hangul */
      /* 123 */   SDL_SCANCODE_UNKNOWN,   /* Hangul_Hanja */
      /* 124 */   SDL_SCANCODE_INTERNATIONAL3, /* Yen */
***************
*** 356,363 ****
      /* 176 */   SDL_SCANCODE_UNKNOWN,
      /* 177 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollUp */
      /* 178 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollDown */
!     /* 179 */   SDL_SCANCODE_UNKNOWN,   /* parenleft */
!     /* 180 */   SDL_SCANCODE_UNKNOWN,   /* parenright */
      /* 181 */   SDL_SCANCODE_UNKNOWN,   /* XF86New */
      /* 182 */   SDL_SCANCODE_AGAIN,
      /* 183 */   SDL_SCANCODE_F13,       /* XF86Tools */
--- 356,363 ----
      /* 176 */   SDL_SCANCODE_UNKNOWN,
      /* 177 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollUp */
      /* 178 */   SDL_SCANCODE_UNKNOWN,   /* XF86ScrollDown */
!     /* 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 */
***************
*** 385,391 ****
      /* 205 */   SDL_SCANCODE_UNKNOWN,   /* XF86Suspend */
      /* 206 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
      /* 207 */   SDL_SCANCODE_AUDIOPLAY,
!     /* 208 */   SDL_SCANCODE_AUDIONEXT,
      /* 209 */   SDL_SCANCODE_UNKNOWN,
      /* 210 */   SDL_SCANCODE_PRINTSCREEN,
      /* 211 */   SDL_SCANCODE_UNKNOWN,
--- 385,391 ----
      /* 205 */   SDL_SCANCODE_UNKNOWN,   /* XF86Suspend */
      /* 206 */   SDL_SCANCODE_UNKNOWN,   /* XF86Close */
      /* 207 */   SDL_SCANCODE_AUDIOPLAY,
!     /* 208 */   SDL_SCANCODE_AUDIOFASTFORWARD,
      /* 209 */   SDL_SCANCODE_UNKNOWN,
      /* 210 */   SDL_SCANCODE_PRINTSCREEN,
      /* 211 */   SDL_SCANCODE_UNKNOWN,