Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

sdl

- fix win32 mapping of alpha-numeric keys after scancode changes
  • Loading branch information
jorgenpt committed Feb 26, 2013
1 parent 1ef5ff3 commit 3de4c3d240667e75f11ef756f3651728352bcbd2
Showing with 13 additions and 3 deletions.
  1. +13 −3 src/video/windows/SDL_windowskeyboard.c
@@ -165,8 +165,12 @@ WIN_UpdateKeymap()
}
/* Don't allow the number keys right above the qwerty row to translate or the top left key (grave/backquote) */
/* not mapping numbers fixes the AZERTY layout (french) causing non-shifted number to appear by default */
if ( ( scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0 ) ||
scancode == SDL_SCANCODE_GRAVE ) {
if ( scancode == SDL_SCANCODE_GRAVE ) {
keymap[scancode] = SDLK_BACKQUOTE;
continue;
}
if ( scancode >= SDL_SCANCODE_1 && scancode <= SDL_SCANCODE_0 ) {
keymap[scancode] = SDLK_1 + ( scancode - SDL_SCANCODE_1 );
continue;
}

@@ -175,7 +179,13 @@ WIN_UpdateKeymap()
int ch;
ch = (MapVirtualKey( vk, MAPVK_VK_TO_CHAR ) & 0x7FFF);
if ( ch )
keymap[scancode] = ch;
{
if ( ch >= 'A' && ch <= 'Z' )
keymap[scancode] = SDLK_a + ( ch - 'A' );
else
keymap[scancode] = ch;
}

}
}

0 comments on commit 3de4c3d

Please sign in to comment.