On Thursday 25 July 2013 10:56:25 Milan Straka wrote:
> Package: libmupen64plus2
> Version: 2.0-1
> 
> When upgrading libmupen64plus2 from 1.99.5-6 to 2.0-1, using 0-9 keys to
> change save slot stopped working. The reason is that the version 2.0-1
> uses SDL 2.0 and uses scancodes instead of keysyms to test for keys 0-9,
> in the following way:
> 
> src/main/eventloop.c:457
>     else if (keysym >= SDL_SCANCODE_0 && keysym <= SDL_SCANCODE_9)
>         main_state_set_slot(keysym - SDL_SCANCODE_0);
> 
> Unfortunately, the values of scancodes for 0-9 are not sequential:
> SDL2/SDL_scancode.h:81
>     SDL_SCANCODE_1 = 30,
>     SDL_SCANCODE_2 = 31,
>     SDL_SCANCODE_3 = 32,
>     SDL_SCANCODE_4 = 33,
>     SDL_SCANCODE_5 = 34,
>     SDL_SCANCODE_6 = 35,
>     SDL_SCANCODE_7 = 36,
>     SDL_SCANCODE_8 = 37,
>     SDL_SCANCODE_9 = 38,
>     SDL_SCANCODE_0 = 39,
> 
> Therefore, keysym is never >= SDL_SCANCODE_0 and <= SDL_SCANCODE_9.
> 
> According to SDL2 docs, "The values in this enumeration are based on the
> USB usage page standard http://www.usb.org/developers/docs/";, so it is
> probably safe to assume that they will not be changed and so
> SDL_SCANCODE_1 to SDL_SCANCODE_9 are sequential, and test for
> SDL_SCANCODE_0 separately.

Thanks a lot for the bug report.

I will change it later when I have access to an actual PC (unfortunatelly, 
this can take quite long because I am currently on vacation). But I try my 
best to find some computing device were I can prepare the upload.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to