Keypad5 without numlock?

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

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

SDLK_KP5

See here for nice complete list:
http://www.libsdl.org/cgi/docwiki.cgi/SDLKey

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

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

Chris wrote:

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.

The problem is that all of the other digits have non-numlock
functionality.
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.

Chris wrote:

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.

The problem is that all of the other digits have non-numlock
functionality.
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.On Wed, May 31, 2006 at 08:24:09PM -0400, Alex Volkov wrote:

-Alex.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

“John Popplewell” wrote:> On Wed, May 31, 2006 at 08:24:09PM -0400, Alex Volkov wrote:

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