OpenJK icon indicating copy to clipboard operation
OpenJK copied to clipboard

SDL - There is no reason to know if shift is down when pressing a numpad key with NumLock ON

Open mandaxyzw opened this issue 2 years ago • 3 comments

Operating system and version: Windows 10 Pro 64-bit (10.0, Build 18363)

Description of the bug (and if possible, steps to reproduce the bug):

SDL_Keymod mod = SDL_GetModState();
int shift = !!(mod & KMOD_SHIFT); // The reason of !! is to convert number into 0 or 1 and it's not a Boolean but an int.

// Steps:
//
// - The shift key is down.
// - I press the normal keys A or B or C or ...
// - The value of the variable 'shift' is 1 which is correct.
//
// - The shift key is down AND the numlock is ON.
// - I press the numpad keys 1 or 2 or 3 or ...
// - The value of the variable 'shift' is 0 which is wrong because what I expected is 1 but it's not.

What did you expect to happen instead? I want to get the input [End] for [1], [↓] for [2], [PgDn] for [3], etc. but I can't because there is no reason to know if the shift is down with NumLock ON because as I explain above, the value of 'shift' is always 0 at the time when the numpad keys are down, but 'shift' will be 1 at the time when the numpad keys are up.

mandaxyzw avatar Apr 28 '22 12:04 mandaxyzw

Code block doesn't exist within OpenJK

ensiform avatar Apr 29 '22 11:04 ensiform

This sounds like an issue with SDL to me? I'd suggest submitting an issue to the SDL library instead

xycaleth avatar Apr 29 '22 20:04 xycaleth

Pretty sure we made the NumLock to behave like the vanilla game in terms of how the key works though compared to say ioquake3 behavior.

ensiform avatar Apr 29 '22 23:04 ensiform