src/video/ataricommon/SDL_ikbdevents.c
changeset 1209 a55ac374271c
parent 1082 48436ffdf677
child 1221 8ef3e7e92a91
     1.1 --- a/src/video/ataricommon/SDL_ikbdevents.c	Fri Dec 23 09:40:15 2005 +0000
     1.2 +++ b/src/video/ataricommon/SDL_ikbdevents.c	Sun Jan 01 19:14:11 2006 +0000
     1.3 @@ -41,6 +41,7 @@
     1.4  #include "SDL_events_c.h"
     1.5  
     1.6  #include "SDL_atarikeys.h"
     1.7 +#include "SDL_atarievents_c.h"
     1.8  #include "SDL_ikbdinterrupt_s.h"
     1.9  
    1.10  /* Special keys state */
    1.11 @@ -75,7 +76,8 @@
    1.12  static unsigned char *tab_unshift, *tab_shift, *tab_caps;
    1.13  static SDLKey keymap[ATARIBIOS_MAXKEYS];
    1.14  
    1.15 -static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysym);
    1.16 +static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysym,
    1.17 +	SDL_bool pressed);
    1.18  
    1.19  void AtariIkbd_InitOSKeymap(_THIS)
    1.20  {
    1.21 @@ -171,13 +173,15 @@
    1.22  	for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
    1.23  		/* Key pressed ? */
    1.24  		if (SDL_AtariIkbd_keyboard[i]==KEY_PRESSED) {
    1.25 -			SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(i, specialkeys, &keysym));
    1.26 +			SDL_PrivateKeyboard(SDL_PRESSED,
    1.27 +				TranslateKey(i, specialkeys, &keysym, SDL_TRUE));
    1.28  			SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
    1.29  		}
    1.30  			
    1.31  		/* Key released ? */
    1.32  		if (SDL_AtariIkbd_keyboard[i]==KEY_RELEASED) {
    1.33 -			SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(i, specialkeys, &keysym));
    1.34 +			SDL_PrivateKeyboard(SDL_RELEASED,
    1.35 +				TranslateKey(i, specialkeys, &keysym, SDL_FALSE));
    1.36  			SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
    1.37  		}
    1.38  	}
    1.39 @@ -209,7 +213,8 @@
    1.40  	}
    1.41  }
    1.42  
    1.43 -static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysym)
    1.44 +static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysym,
    1.45 +	SDL_bool pressed)
    1.46  {
    1.47  	unsigned char asciicode;
    1.48  
    1.49 @@ -236,6 +241,9 @@
    1.50  
    1.51  	keysym->mod = KMOD_NONE;
    1.52  	keysym->unicode = 0;
    1.53 +	if (pressed && (asciicode!=0)) {
    1.54 +		keysym->unicode = SDL_AtariToUnicode(asciicode);
    1.55 +	}
    1.56  
    1.57  	return(keysym);
    1.58  }