Win32 specific problems - some fixes

Hi,

Yes, I can do that. I’m not sure what to do about backslash and backquote
though…

Great! Here are some changes for backslash :--------------------------------------
File : windx5/SDL_dx5events.c
Function: void DX5_InitOSKeymap(_THIS)
{
#ifndef DIK_PAUSE
#define DIK_PAUSE 0xC5
#endif
#ifndef DIK_OEM_102
#define DIK_OEM_102 0x56 /* < > | on UK/Germany keyboards */
#endif

DIK_keymap[DIK_PAUSE] = SDLK_PAUSE;
DIK_keymap[DIK_OEM_102] = SDLK_BACKSLASH;

and backquote :


File : windib/SDL_vkeys.h

#define VK_GRAVE 0xC0
#define VK_BACKTICK 0xDF

File : windib/SDL_dibevents.c
Function: void DIB_InitOSKeymap(_THIS)

VK_keymap[VK_GRAVE] = SDLK_BACKQUOTE;
VK_keymap[VK_BACKTICK] = SDLK_BACKQUOTE;

[suspicious … but return and enter aren’t perfect either]

A fix for the NUMLOCK and CAPSLOCK behaviour :


File : "wincommon/SDL_sysevents.c"
Function: “static void WIN_GetKeyboardState(void)”

114 SDLMod state;
115 BYTE keyboard[256];

Uint8 *kstate = SDL_GetKeyState(NULL);
116
117 state = KMOD_NONE;

137 if ( keyboard[VK_NUMLOCK] & 0x01) {
138 state |= KMOD_NUM;
kstate[SDLK_NUMLOCK] = SDL_PRESSED;
139 }
140 if ( keyboard[VK_CAPITAL] & 0x01) {
141 state |= KMOD_CAPS;
kstate[SDLK_CAPSLOCK] = SDL_PRESSED;
142 }
[description/ explanation earlier in thread …]


I had no luck with printscreen or Alt-Gr using “windib”,
printscreen only generates a WM_KEYUP event and Alt-Gr
generates the left-ctrl and right-alt events that I am seeing!

Does this on all my keyboards (same layout but different ages and
"quality") - must be a feature!

cheers,
John.

----- Original Message -----
From: slouken@devolution.com (Sam Lantinga)
To:
Sent: Friday, March 01, 2002 6:23 PM
Subject: Re: [SDL] Win32 specific problems

In fact, using CVS and the “checkkeys” test application I find that for
the “directx” drivers :

PAUSE - “Key pressed: 318-break modifiers: NUM”
\ - "Unknown Key (scancode = 86) pressed () modifiers: NUM"
NUMLOCK - is erratic sometimes works, sometimes doesn’t.

and for the “windib” drivers :

PAUSE - "Key pressed: 19-pause modifiers: NUM"
PRINTSCREEN - no response!
BACKQUOTE - "Unknown Key (scancode = 41) pressed (`) modifiers: NUM"
ALT-GR - does left-ctrl and right-alt!

How about making the pause key consistent, Sam?

Yes, I can do that. I’m not sure what to do about backslash and backquote
though…

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


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

Thank you very much! I’ve applied your fixes to CVS. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment