Trouble with arrow keys in Windows

I’m using SDL 1.3 and have arrow keys working in Linux using
SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_UP, and
SDL_SCANCODE_DOWN. In Windows, these tokens print out as 79, 80, 81,
and 82, which are the values in SDL_default_keymap in SDL_keyboard.c.

But I can only make the arrow keys work in Windows by checking the
SDL_GetKeyboardState() array elements with 90, 92, 94, and 96. These
values appear to map properly to the values in scancodes_xfree86.h and
not to the left/right/up/down values in scancodes_win32.h. Could I be
compiling SDL incorrectly or something (I’m compiling with
VisualStudio 2008 EE)? I’m not sure where to look next for the
problem…–
Terry Welsh / mogumbo ‘at’ gmail.com
www.reallyslick.com / www.mogumbo.com

This is a known bug on the TODO list:
http://bugzilla.libsdl.org/show_bug.cgi?id=743On Sun, Nov 1, 2009 at 4:22 PM, Terry Welsh wrote:

I’m using SDL 1.3 and have arrow keys working in Linux using
SDL_SCANCODE_LEFT, SDL_SCANCODE_RIGHT, SDL_SCANCODE_UP, and
SDL_SCANCODE_DOWN. ?In Windows, these tokens print out as 79, 80, 81,
and 82, which are the values in SDL_default_keymap in SDL_keyboard.c.

But I can only make the arrow keys work in Windows by checking the
SDL_GetKeyboardState() array elements with 90, 92, 94, and 96. ?These
values appear to map properly to the values in scancodes_xfree86.h and
not to the left/right/up/down values in scancodes_win32.h. ?Could I be
compiling SDL incorrectly or something (I’m compiling with
VisualStudio 2008 EE)? ?I’m not sure where to look next for the
problem…

Terry Welsh ?/ ?mogumbo ‘at’ gmail.com
www.reallyslick.com ?/ ?www.mogumbo.com


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


-Sam Lantinga, Founder and President, Galaxy Gameworks LLC