Commit a4b20c80 authored by Sam Lantinga's avatar Sam Lantinga

Date: Wed, 1 Mar 2006 23:52:09 +0100

From: Sam Hocevar
Subject: [SDL] [patch] aalib driver

   Hi there. The attached patch fixes a buffer overflow in the aalib
driver and also adds a workaround for a conflict between arrow keys and
the numeric keypad that have the same scancode on aalib. The patch gives
precedence to the arrow keys.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401462
parent 95425a11
...@@ -126,12 +126,6 @@ void AA_InitOSKeymap(_THIS) ...@@ -126,12 +126,6 @@ void AA_InitOSKeymap(_THIS)
for ( i=0; i<SDL_arraysize(keymap); ++i ) for ( i=0; i<SDL_arraysize(keymap); ++i )
keymap[i] = SDLK_UNKNOWN; keymap[i] = SDLK_UNKNOWN;
keymap[AA_ESC] = SDLK_ESCAPE;
keymap[AA_UP] = SDLK_UP;
keymap[AA_DOWN] = SDLK_DOWN;
keymap[AA_LEFT] = SDLK_LEFT;
keymap[AA_RIGHT] = SDLK_RIGHT;
/* Alphabet keys */ /* Alphabet keys */
for ( i = 0; i<26; ++i ){ for ( i = 0; i<26; ++i ){
keymap['a' + i] = SDLK_a+i; keymap['a' + i] = SDLK_a+i;
...@@ -179,10 +173,20 @@ void AA_InitOSKeymap(_THIS) ...@@ -179,10 +173,20 @@ void AA_InitOSKeymap(_THIS)
keymap[293] = SDLK_KP7; keymap[293] = SDLK_KP7;
keymap[295] = SDLK_KP8; keymap[295] = SDLK_KP8;
keymap[298] = SDLK_KP9; keymap[298] = SDLK_KP9;
keymap[AA_ESC] = SDLK_ESCAPE;
keymap[AA_UP] = SDLK_UP;
keymap[AA_DOWN] = SDLK_DOWN;
keymap[AA_LEFT] = SDLK_LEFT;
keymap[AA_RIGHT] = SDLK_RIGHT;
} }
static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym) static SDL_keysym *TranslateKey(int scancode, SDL_keysym *keysym)
{ {
/* Sanity check */
if ( scancode >= SDL_arraysize(keymap) )
scancode = AA_UNKNOWN;
/* Set the keysym information */ /* Set the keysym information */
keysym->scancode = scancode; keysym->scancode = scancode;
keysym->sym = keymap[scancode]; keysym->sym = keymap[scancode];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment