1.1 --- a/src/video/ataricommon/SDL_biosevents.c Fri Dec 23 09:40:15 2005 +0000
1.2 +++ b/src/video/ataricommon/SDL_biosevents.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_xbiosevents_c.h"
1.9
1.10 /* To save state of keyboard */
1.11 @@ -64,7 +65,8 @@
1.12 /* The translation tables from a console scancode to a SDL keysym */
1.13 static SDLKey keymap[ATARIBIOS_MAXKEYS];
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 void UpdateSpecialKeys(int special_keys_state);
1.19
1.20 void AtariBios_InitOSKeymap(_THIS)
1.21 @@ -135,11 +137,13 @@
1.22 for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
1.23 /* Key pressed ? */
1.24 if (bios_currentkeyboard[i] && !bios_previouskeyboard[i])
1.25 - SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(i, bios_currentascii[i], &keysym));
1.26 + SDL_PrivateKeyboard(SDL_PRESSED,
1.27 + TranslateKey(i, bios_currentascii[i], &keysym, SDL_TRUE));
1.28
1.29 /* Key unpressed ? */
1.30 if (bios_previouskeyboard[i] && !bios_currentkeyboard[i])
1.31 - SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(i, bios_currentascii[i], &keysym));
1.32 + SDL_PrivateKeyboard(SDL_RELEASED,
1.33 + TranslateKey(i, bios_currentascii[i], &keysym, SDL_FALSE));
1.34 }
1.35
1.36 SDL_AtariXbios_PostMouseEvents(this);
1.37 @@ -165,7 +169,8 @@
1.38 UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
1.39 }
1.40
1.41 -static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym)
1.42 +static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
1.43 + SDL_bool pressed)
1.44 {
1.45 /* Set the keysym information */
1.46 keysym->scancode = scancode;
1.47 @@ -177,6 +182,9 @@
1.48
1.49 keysym->mod = KMOD_NONE;
1.50 keysym->unicode = 0;
1.51 + if (pressed && (asciicode!=0)) {
1.52 + keysym->unicode = SDL_AtariToUnicode(asciicode);
1.53 + }
1.54
1.55 return(keysym);
1.56 }