Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
sdl
Browse files Browse the repository at this point in the history
- fix win32 mapping of alpha-numeric keys after scancode changes
  • Loading branch information
jorgenpt committed Feb 26, 2013
1 parent 1ef5ff3 commit 3de4c3d
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/video/windows/SDL_windowskeyboard.c
Expand Up @@ -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;
}

Expand All @@ -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;
}

}
}

Expand Down

0 comments on commit 3de4c3d

Please sign in to comment.