diff options
author | Sam Lantinga <slouken@libsdl.org> | 2017-07-20 10:46:38 -0700 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2017-07-20 10:46:38 -0700 |
commit | da2a76d220c77424d88ee93c63faae194fd27d89 (patch) | |
tree | 819dc0eb1f9c32f2c03322ffda50dec31c2853a5 /include/SDL_scancode.h | |
parent | 6d7be209c20bc438e97f0d46c170e8f82315e717 (diff) |
Fixed bug 3703 - Missing media keys support on Amazon Fire TV remote control
Holger Schemel
Summary: This patch adds support for key events for the "rewind" and "fast forward" media keys on the Amazon Fire TV remote control.
How to reproduce the problem: Run Android build of SDL2 application on the Amazon Fire TV (tested with "stick" version) and log key events.
Expected behaviour: Every key pressed on the Fire TV remote control should result in a corresponding key event (pressed/released).
Observed behaviour: Of the bottom row of buttons on the Fire TV remote control, only the "play/pause" (middle) button generates a key event, while the "rewind" (left) and "fast forward" (right) buttons to not generate any event at all.
The attached patch adds support for these two missing buttons/keys.
Note 1: Some missing definitions were added for the already existing key codes SDL_SCANCODE_APP1 and SDL_SCANCODE_APP2 (to keep up the correct order of enumerations / array positions when adding the two new key codes).
Note 2: Definitions in "scancodes_linux.h" and "scancodes_xfree86.h" (to also add support for these keys on other platforms) were added without testing. However, I was unable to find corresponding definitions for these two media keys for Windows and Mac OS X.
Note 3: I have also updated the (broken) link to the USB usage page standard PDF document (comment in "include/SDL_scancode.h").
Diffstat (limited to 'include/SDL_scancode.h')
-rw-r--r-- | include/SDL_scancode.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/SDL_scancode.h b/include/SDL_scancode.h index 1172add39d..1d55212048 100644 --- a/include/SDL_scancode.h +++ b/include/SDL_scancode.h @@ -38,7 +38,7 @@ * SDL_Event structure. * * The values in this enumeration are based on the USB usage page standard: - * http://www.usb.org/developers/devclass_docs/Hut1_12v2.pdf + * http://www.usb.org/developers/hidpage/Hut1_12v2.pdf */ typedef enum { @@ -390,6 +390,18 @@ typedef enum /* @} *//* Walther keys */ + /** + * \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, + + /* @} *//* Usage page 0x0C (additional media keys) */ + /* Add any other keys here. */ SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes |