# HG changeset patch # User Patrice Mandin # Date 1158182353 0 # Node ID c3625a895cafebc4e8efb5e0c3d304985b64b104 # Parent bf1586b58ef2e0fd738228288bab26f436a1566c Use new keyboard mapping routines diff -r bf1586b58ef2 -r c3625a895caf src/video/gem/SDL_gemevents.c --- a/src/video/gem/SDL_gemevents.c Wed Sep 13 21:18:35 2006 +0000 +++ b/src/video/gem/SDL_gemevents.c Wed Sep 13 21:19:13 2006 +0000 @@ -41,89 +41,28 @@ #include "../ataricommon/SDL_xbiosevents_c.h" #include "../ataricommon/SDL_ataridevmouse_c.h" -/* Defines */ - -#define ATARIBIOS_MAXKEYS 128 - /* Variables */ static unsigned char gem_currentkeyboard[ATARIBIOS_MAXKEYS]; static unsigned char gem_previouskeyboard[ATARIBIOS_MAXKEYS]; -static unsigned char gem_currentascii[ATARIBIOS_MAXKEYS]; - -/* The translation tables from a console scancode to a SDL keysym */ -static SDLKey keymap[ATARIBIOS_MAXKEYS]; /* Functions prototypes */ -static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym, - SDL_bool pressed); static int do_messages(_THIS, short *message); static void do_keyboard(short kc, short ks); static void do_mouse(_THIS, short mx, short my, short mb, short ks); /* Functions */ -static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym, - SDL_bool pressed) -{ - /* Set the keysym information */ - keysym->scancode = scancode; - - if (asciicode) - keysym->sym = asciicode; - else - keysym->sym = keymap[scancode]; - - keysym->mod = KMOD_NONE; - keysym->unicode = 0; - if (SDL_TranslateUNICODE && pressed) { - keysym->unicode = SDL_AtariToUnicodeTable[asciicode]; - } - - return(keysym); -} - void GEM_InitOSKeymap(_THIS) { - int i; - SDL_memset(gem_currentkeyboard, 0, sizeof(gem_currentkeyboard)); SDL_memset(gem_previouskeyboard, 0, sizeof(gem_previouskeyboard)); - SDL_memset(gem_currentascii, 0, sizeof(gem_currentascii)); - - /* Initialize keymap */ - for ( i=0; i>8) & 127; - asciicode=kc & 255; - + scancode=(kc>>8) & (ATARIBIOS_MAXKEYS-1); gem_currentkeyboard[scancode]=0xFF; - gem_currentascii[scancode]=asciicode; } /* Read special keys */