Skip to content

Commit

Permalink
added some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Apr 29, 2024
1 parent 8ca4f2e commit 436f054
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
9 changes: 8 additions & 1 deletion include/SDL_scancode.h
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,13 @@ typedef enum

/* Add any other keys here. */

/**
* \name webOS keys
*
* These are values that are used on webOS.
* The mapping can be found in decompiled keyboard_handle_key function as a series of int arrays.
*/
/* @{ */
SDL_SCANCODE_WEBOS_1 = 340,
SDL_SCANCODE_WEBOS_2 = 341,
SDL_SCANCODE_WEBOS_3 = 342,
Expand All @@ -453,7 +460,7 @@ typedef enum
SDL_SCANCODE_WEBOS_BLUE = 489 /**< webOS remote blue button */,
SDL_SCANCODE_WEBOS_GUIDE = 495 /**< webOS remote guide button */,
SDL_SCANCODE_WEBOS_EXIT = 505 /**< webOS remote exit button */,

/* @} *//* webOS keys */

SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes
for array bounds */
Expand Down
3 changes: 2 additions & 1 deletion src/events/SDL_scancode_webos.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ SDL_Scancode SDL_GetWebOSScancode(int keycode)
return SDL_SCANCODE_AUDIOREWIND;
case 216:
return SDL_SCANCODE_AUDIOFASTFORWARD;
default:
return SDL_SCANCODE_UNKNOWN;
}
return SDL_SCANCODE_UNKNOWN;
}

#endif /* __WEBOS__ */
Expand Down
4 changes: 4 additions & 0 deletions src/events/SDL_scancode_webos_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@

#ifdef __WEBOS__

/**
* Get SDL_Scancode from wayland keycode.
* The mapping can be found in /usr/share/X11/xkb/keycodes/lg
*/
extern SDL_Scancode SDL_GetWebOSScancode(int keycode);

#endif /* __WEBOS__ */
Expand Down

0 comments on commit 436f054

Please sign in to comment.