Virtual keys and SDL's windib

I’ve noticed that the keypad enter key and the standard Return key on my
keyboard are both reported to be one and the same (“VK_RETURN”) under the
windib video driver. Is there a reason we don’t check scancodes, and just
virtual keys?

I know they are more portable to various keyboards, and for the most part
they work, but can we check the scancodes for any keys that might be
duplicates (such as enter/return), and default to one or the other if the
scancode isn’t a recognized value?

If this is acceptable, I’ll do the work and send in a patch, but I’d like
to know if there’s a good reason not to ahead of time. :slight_smile:

–ryan.

I’ve noticed that the keypad enter key and the standard Return key on my
keyboard are both reported to be one and the same (“VK_RETURN”) under the
windib video driver. Is there a reason we don’t check scancodes, and just
virtual keys?

I know they are more portable to various keyboards, and for the most part
they work, but can we check the scancodes for any keys that might be
duplicates (such as enter/return), and default to one or the other if the
scancode isn’t a recognized value?

If this is acceptable, I’ll do the work and send in a patch, but I’d like
to know if there’s a good reason not to ahead of time. :slight_smile:

No, that sounds like a good idea. Make sure that the virtual keys are
checked first, and then if they match a known virtual key, then do scancode
matching. Make sure that there isn’t much overhead on the checking.

See ya!
-Sam Lantinga, Lead Programmer, Loki Software, Inc.

No, that sounds like a good idea. Make sure that the virtual keys are
checked first, and then if they match a known virtual key, then do scancode
matching. Make sure that there isn’t much overhead on the checking.

No good; both the keypad enter and the regular enter claim to be scancode
28. I tried this on Win98 and WinNT on several computers; apparently
DirectInput is the only way to get the correct scancodes out of these
keys (the SDL directx driver reports correct scancodes and differentiates
the keys without further patching).

Oh well.

–ryan.