Trouble with arrow keys in Windows

View: New views
2 Messages — Rating Filter:   Alert me  

Trouble with arrow keys in Windows

by Terry Welsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Re: Trouble with arrow keys in Windows

by Sam Lantinga-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

This is a known bug on the TODO list:
http://bugzilla.libsdl.org/show_bug.cgi?id=743

On Sun, Nov 1, 2009 at 4:22 PM, Terry Welsh <mogumbo@...> 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@...
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>



--
        -Sam Lantinga, Founder and President, Galaxy Gameworks LLC
_______________________________________________
SDL mailing list
SDL@...
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org