The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
keypad5 without numlock?
Chris
Guest

What is the number/constant for checking usage of the keypad5 button when
numlock is off? Any help appreciated.
keypad5 without numlock?
ÀÞÜÐÝ ºØàØÛØç
Guest

Quote:
What is the number/constant for checking usage of the keypad5 button when
numlock is off? Any help appreciated.

SDLK_KP5
keypad5 without numlock?
ÀÞÜÐÝ ºØàØÛØç
Guest

See here for nice complete list:
http://www.libsdl.org/cgi/docwiki.cgi/SDLKey
keypad5 without numlock?
Chris
Guest

????? ??????? <roman.kyrylych <at> gmail.com> writes:

Quote:
Quote:
What is the number/constant for checking usage of
the keypad5 button when numlock is off? Any help
appreciated.

SDLK_KP5

I've read the lists of SDL keyboard mappings, and the only key code that maps to
that button is SDLK_KP5 -- and, unfortunately, from the application that I've
built with SDL, SDLK_KP5 only works when pressing keypad5 when NumLock is *on*.
The same is true for SDLK_KP1 through SDLK_KP9.

The problem is that all of the other digits have non-numlock functionality. For
example, keys 2, 4, 6, and 8 are down, left, right, and up (respectively), while
keys 1, 7, 3, and 9 are end, home, pgdown, and pgup, respectively. So when
NumLock is off, those keys are mappable also to SDLK_DOWN, SDLK_LEFT,
SDLK_RIGHT, SDLK_UP, SDLK_END, SDLK_HOME, SDLK_PAGEDOWN, and SDLK_PAGEUP.
However -- key 5 doesn't seem to have a non-numlock functionality!

What would be nice is if SDLK_KP5 worked for that key when numlock was off as
well as on. However, from the application that I've built so far, that doesn't
seem to be the situation. Any further help?

thanks,
crichmon
keypad5 without numlock?
Alex Volkov
Guest

Chris wrote:
Quote:
from the application that I've built with SDL, SDLK_KP5 only works
when pressing keypad5 when NumLock is *on*.
The same is true for SDLK_KP1 through SDLK_KP9.

On my Win2k system, the DirectX driver produces SDLK_KP5 (and 1..9) equally
with NumLock ON or OFF. The WinDib driver, however, produces SDLK_LEFT et al
for the numpad with NumLock OFF.

Quote:
The problem is that all of the other digits have non-numlock
functionality.
Quote:
However -- key 5 doesn't seem to have a non-numlock functionality!

Here, the key produced by WinDib for keypad-5 w/ NumLock OFF is SDLK_CLEAR
(whatever that is).

-Alex.
keypad5 without numlock?
John Popplewell
Guest

On Wed, May 31, 2006 at 08:24:09PM -0400, Alex Volkov wrote:
Quote:
Chris wrote:
Quote:
from the application that I've built with SDL, SDLK_KP5 only works
when pressing keypad5 when NumLock is *on*.
The same is true for SDLK_KP1 through SDLK_KP9.

On my Win2k system, the DirectX driver produces SDLK_KP5 (and 1..9) equally
with NumLock ON or OFF. The WinDib driver, however, produces SDLK_LEFT et al
for the numpad with NumLock OFF.

Quote:
The problem is that all of the other digits have non-numlock
functionality.
Quote:
However -- key 5 doesn't seem to have a non-numlock functionality!

Here, the key produced by WinDib for keypad-5 w/ NumLock OFF is SDLK_CLEAR
(whatever that is).

Hi Alex,

this is fixed in svn - see https://bugzilla.libsdl.org/show_bug.cgi?id=164
The directx and windib driver now return SDLK_KP5 regardless of the
NumLock setting (the original directx driver behavior),

regards,
John.

Quote:
-Alex.



_______________________________________________
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl
keypad5 without numlock?
Chris
Guest

"John Popplewell" <john at johnnypops.demon.co.uk> wrote:
Quote:
On Wed, May 31, 2006 at 08:24:09PM -0400, Alex Volkov wrote:

Quote:
Here, the key produced by WinDib for keypad-5 w/ NumLock
OFF is SDLK_CLEAR (whatever that is).

Hi Alex,

this is fixed in svn - see
https://bugzilla.libsdl.org/show_bug.cgi?id=164
The directx and windib driver now return SDLK_KP5
regardless of the NumLock setting (the original directx
driver behavior)

Thanks Alex, Thanks John, for both solutions.


crichmon