src/video/gem/SDL_gemevents.c
changeset 1209 a55ac374271c
parent 1092 1f37386ef508
child 1221 8ef3e7e92a91
     1.1 --- a/src/video/gem/SDL_gemevents.c	Fri Dec 23 09:40:15 2005 +0000
     1.2 +++ b/src/video/gem/SDL_gemevents.c	Sun Jan 01 19:14:11 2006 +0000
     1.3 @@ -44,6 +44,7 @@
     1.4  #include "SDL_gemvideo.h"
     1.5  #include "SDL_gemevents_c.h"
     1.6  #include "SDL_atarikeys.h"	/* for keyboard scancodes */
     1.7 +#include "SDL_atarievents_c.h"
     1.8  #include "SDL_xbiosinterrupt_s.h"
     1.9  
    1.10  /* Defines */
    1.11 @@ -61,14 +62,16 @@
    1.12  
    1.13  /* Functions prototypes */
    1.14  
    1.15 -static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym);
    1.16 +static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
    1.17 +	SDL_bool pressed);
    1.18  static int do_messages(_THIS, short *message);
    1.19  static void do_keyboard(short kc, short ks);
    1.20  static void do_mouse(_THIS, short mx, short my, short mb, short ks);
    1.21  
    1.22  /* Functions */
    1.23  
    1.24 -static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym)
    1.25 +static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
    1.26 +	SDL_bool pressed)
    1.27  {
    1.28  	/* Set the keysym information */
    1.29  	keysym->scancode = scancode;
    1.30 @@ -80,6 +83,9 @@
    1.31  
    1.32  	keysym->mod = KMOD_NONE;
    1.33  	keysym->unicode = 0;
    1.34 +	if (pressed && (asciicode!=0)) {
    1.35 +		keysym->unicode = SDL_AtariToUnicode(asciicode);
    1.36 +	}
    1.37  
    1.38  	return(keysym);
    1.39  }
    1.40 @@ -205,11 +211,13 @@
    1.41  	for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
    1.42  		/* Key pressed ? */
    1.43  		if (gem_currentkeyboard[i] && !gem_previouskeyboard[i])
    1.44 -			SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(i, gem_currentascii[i], &keysym));
    1.45 +			SDL_PrivateKeyboard(SDL_PRESSED,
    1.46 +				TranslateKey(i, gem_currentascii[i], &keysym, SDL_TRUE));
    1.47  			
    1.48  		/* Key unpressed ? */
    1.49  		if (gem_previouskeyboard[i] && !gem_currentkeyboard[i])
    1.50 -			SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(i, gem_currentascii[i], &keysym));
    1.51 +			SDL_PrivateKeyboard(SDL_RELEASED,
    1.52 +				TranslateKey(i, gem_currentascii[i], &keysym, SDL_FALSE));
    1.53  	}
    1.54  
    1.55  	memcpy(gem_previouskeyboard,gem_currentkeyboard,sizeof(gem_previouskeyboard));