diff options
author | notaz | 2012-07-22 19:40:11 +0300 |
---|---|---|
committer | notaz | 2012-07-22 19:40:11 +0300 |
commit | 61f97bb0518cde50b243fba8ce2e8a907a0fc2e9 (patch) | |
tree | 0bd9bcfb9ca68197922ee5d12f250fb43638cd17 /frontend/common/in_sdl.c | |
parent | 5905989e5215a4e29e6be27216ea46f288ed16a5 (diff) | |
download | pcsx_rearmed-61f97bb0518cde50b243fba8ce2e8a907a0fc2e9.tar.gz pcsx_rearmed-61f97bb0518cde50b243fba8ce2e8a907a0fc2e9.tar.bz2 pcsx_rearmed-61f97bb0518cde50b243fba8ce2e8a907a0fc2e9.zip |
frontend: support seeking the filelist with letter keys
Diffstat (limited to 'frontend/common/in_sdl.c')
-rw-r--r-- | frontend/common/in_sdl.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/frontend/common/in_sdl.c b/frontend/common/in_sdl.c index e5577be..14749e5 100644 --- a/frontend/common/in_sdl.c +++ b/frontend/common/in_sdl.c @@ -270,8 +270,9 @@ static const struct { #define KEY_PBTN_MAP_SIZE (sizeof(key_pbtn_map) / sizeof(key_pbtn_map[0])) -static int in_sdl_menu_translate(void *drv_data, int keycode) +static int in_sdl_menu_translate(void *drv_data, int keycode, char *charcode) { + int ret = 0; int i; if (keycode < 0) @@ -284,12 +285,22 @@ static int in_sdl_menu_translate(void *drv_data, int keycode) } else { - for (i = 0; i < KEY_PBTN_MAP_SIZE; i++) - if (key_pbtn_map[i].key == keycode) - return key_pbtn_map[i].pbtn; + for (i = 0; i < KEY_PBTN_MAP_SIZE; i++) { + if (key_pbtn_map[i].key == keycode) { + ret = key_pbtn_map[i].pbtn; + break; + } + } + + if (charcode != NULL && (unsigned int)keycode < SDLK_LAST && + in_sdl_keys[keycode] != NULL && in_sdl_keys[keycode][1] == 0) + { + ret |= PBTN_CHAR; + *charcode = in_sdl_keys[keycode][0]; + } } - return 0; + return ret; } static const in_drv_t in_sdl_drv = { |