Added preliminary missingtranslation from Atari to Unicode charset
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401212
This commit is contained in:
parent
8d0272cef5
commit
8e86d24274
6 changed files with 60 additions and 16 deletions
|
@ -127,3 +127,13 @@ void Atari_PumpEvents(_THIS)
|
||||||
/* Call choosen routine */
|
/* Call choosen routine */
|
||||||
this->PumpEvents(this);
|
this->PumpEvents(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Uint16 SDL_AtariToUnicode(Uint8 caracter)
|
||||||
|
{
|
||||||
|
/* Translate from Atari charset to Unicode */
|
||||||
|
if ((caracter>=32) && (caracter<=127)) {
|
||||||
|
return (Uint16) caracter;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
|
@ -44,4 +44,6 @@ extern void (*Atari_ShutdownEvents)(void);
|
||||||
extern void Atari_InitOSKeymap(_THIS);
|
extern void Atari_InitOSKeymap(_THIS);
|
||||||
extern void Atari_PumpEvents(_THIS);
|
extern void Atari_PumpEvents(_THIS);
|
||||||
|
|
||||||
|
extern Uint16 SDL_AtariToUnicode(Uint8 caracter);
|
||||||
|
|
||||||
#endif /* _SDL_ATARI_EVENTS_H_ */
|
#endif /* _SDL_ATARI_EVENTS_H_ */
|
||||||
|
|
|
@ -41,6 +41,7 @@ static char rcsid =
|
||||||
#include "SDL_events_c.h"
|
#include "SDL_events_c.h"
|
||||||
|
|
||||||
#include "SDL_atarikeys.h"
|
#include "SDL_atarikeys.h"
|
||||||
|
#include "SDL_atarievents_c.h"
|
||||||
#include "SDL_xbiosevents_c.h"
|
#include "SDL_xbiosevents_c.h"
|
||||||
|
|
||||||
/* To save state of keyboard */
|
/* To save state of keyboard */
|
||||||
|
@ -64,7 +65,8 @@ enum {
|
||||||
/* The translation tables from a console scancode to a SDL keysym */
|
/* The translation tables from a console scancode to a SDL keysym */
|
||||||
static SDLKey keymap[ATARIBIOS_MAXKEYS];
|
static SDLKey keymap[ATARIBIOS_MAXKEYS];
|
||||||
|
|
||||||
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym);
|
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
|
||||||
|
SDL_bool pressed);
|
||||||
static void UpdateSpecialKeys(int special_keys_state);
|
static void UpdateSpecialKeys(int special_keys_state);
|
||||||
|
|
||||||
void AtariBios_InitOSKeymap(_THIS)
|
void AtariBios_InitOSKeymap(_THIS)
|
||||||
|
@ -135,11 +137,13 @@ void AtariBios_PumpEvents(_THIS)
|
||||||
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
||||||
/* Key pressed ? */
|
/* Key pressed ? */
|
||||||
if (bios_currentkeyboard[i] && !bios_previouskeyboard[i])
|
if (bios_currentkeyboard[i] && !bios_previouskeyboard[i])
|
||||||
SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(i, bios_currentascii[i], &keysym));
|
SDL_PrivateKeyboard(SDL_PRESSED,
|
||||||
|
TranslateKey(i, bios_currentascii[i], &keysym, SDL_TRUE));
|
||||||
|
|
||||||
/* Key unpressed ? */
|
/* Key unpressed ? */
|
||||||
if (bios_previouskeyboard[i] && !bios_currentkeyboard[i])
|
if (bios_previouskeyboard[i] && !bios_currentkeyboard[i])
|
||||||
SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(i, bios_currentascii[i], &keysym));
|
SDL_PrivateKeyboard(SDL_RELEASED,
|
||||||
|
TranslateKey(i, bios_currentascii[i], &keysym, SDL_FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_AtariXbios_PostMouseEvents(this);
|
SDL_AtariXbios_PostMouseEvents(this);
|
||||||
|
@ -165,7 +169,8 @@ static void UpdateSpecialKeys(int special_keys_state)
|
||||||
UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
|
UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym)
|
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
|
||||||
|
SDL_bool pressed)
|
||||||
{
|
{
|
||||||
/* Set the keysym information */
|
/* Set the keysym information */
|
||||||
keysym->scancode = scancode;
|
keysym->scancode = scancode;
|
||||||
|
@ -177,6 +182,9 @@ static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym)
|
||||||
|
|
||||||
keysym->mod = KMOD_NONE;
|
keysym->mod = KMOD_NONE;
|
||||||
keysym->unicode = 0;
|
keysym->unicode = 0;
|
||||||
|
if (pressed && (asciicode!=0)) {
|
||||||
|
keysym->unicode = SDL_AtariToUnicode(asciicode);
|
||||||
|
}
|
||||||
|
|
||||||
return(keysym);
|
return(keysym);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ static char rcsid =
|
||||||
#include "SDL_events_c.h"
|
#include "SDL_events_c.h"
|
||||||
|
|
||||||
#include "SDL_atarikeys.h"
|
#include "SDL_atarikeys.h"
|
||||||
|
#include "SDL_atarievents_c.h"
|
||||||
#include "SDL_xbiosevents_c.h"
|
#include "SDL_xbiosevents_c.h"
|
||||||
|
|
||||||
/* To save state of keyboard */
|
/* To save state of keyboard */
|
||||||
|
@ -69,7 +70,8 @@ enum {
|
||||||
/* The translation tables from a console scancode to a SDL keysym */
|
/* The translation tables from a console scancode to a SDL keysym */
|
||||||
static SDLKey keymap[ATARIBIOS_MAXKEYS];
|
static SDLKey keymap[ATARIBIOS_MAXKEYS];
|
||||||
|
|
||||||
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym);
|
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
|
||||||
|
SDL_bool pressed);
|
||||||
static void UpdateSpecialKeys(int special_keys_state);
|
static void UpdateSpecialKeys(int special_keys_state);
|
||||||
|
|
||||||
void AtariGemdos_InitOSKeymap(_THIS)
|
void AtariGemdos_InitOSKeymap(_THIS)
|
||||||
|
@ -140,11 +142,13 @@ void AtariGemdos_PumpEvents(_THIS)
|
||||||
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
||||||
/* Key pressed ? */
|
/* Key pressed ? */
|
||||||
if (gemdos_currentkeyboard[i] && !gemdos_previouskeyboard[i])
|
if (gemdos_currentkeyboard[i] && !gemdos_previouskeyboard[i])
|
||||||
SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(i, gemdos_currentascii[i], &keysym));
|
SDL_PrivateKeyboard(SDL_PRESSED,
|
||||||
|
TranslateKey(i, gemdos_currentascii[i], &keysym, SDL_TRUE));
|
||||||
|
|
||||||
/* Key unpressed ? */
|
/* Key unpressed ? */
|
||||||
if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i])
|
if (gemdos_previouskeyboard[i] && !gemdos_currentkeyboard[i])
|
||||||
SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(i, gemdos_currentascii[i], &keysym));
|
SDL_PrivateKeyboard(SDL_RELEASED,
|
||||||
|
TranslateKey(i, gemdos_currentascii[i], &keysym, SDL_FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_AtariXbios_PostMouseEvents(this);
|
SDL_AtariXbios_PostMouseEvents(this);
|
||||||
|
@ -170,7 +174,8 @@ static void UpdateSpecialKeys(int special_keys_state)
|
||||||
UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
|
UPDATE_SPECIAL_KEYS(K_CAPSLOCK, SCANCODE_CAPSLOCK);
|
||||||
}
|
}
|
||||||
|
|
||||||
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym)
|
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
|
||||||
|
SDL_bool pressed)
|
||||||
{
|
{
|
||||||
/* Set the keysym information */
|
/* Set the keysym information */
|
||||||
keysym->scancode = scancode;
|
keysym->scancode = scancode;
|
||||||
|
@ -182,6 +187,9 @@ static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym)
|
||||||
|
|
||||||
keysym->mod = KMOD_NONE;
|
keysym->mod = KMOD_NONE;
|
||||||
keysym->unicode = 0;
|
keysym->unicode = 0;
|
||||||
|
if (pressed && (asciicode!=0)) {
|
||||||
|
keysym->unicode = SDL_AtariToUnicode(asciicode);
|
||||||
|
}
|
||||||
|
|
||||||
return(keysym);
|
return(keysym);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ static char rcsid =
|
||||||
#include "SDL_events_c.h"
|
#include "SDL_events_c.h"
|
||||||
|
|
||||||
#include "SDL_atarikeys.h"
|
#include "SDL_atarikeys.h"
|
||||||
|
#include "SDL_atarievents_c.h"
|
||||||
#include "SDL_ikbdinterrupt_s.h"
|
#include "SDL_ikbdinterrupt_s.h"
|
||||||
|
|
||||||
/* Special keys state */
|
/* Special keys state */
|
||||||
|
@ -75,7 +76,8 @@ _KEYTAB *curtables;
|
||||||
static unsigned char *tab_unshift, *tab_shift, *tab_caps;
|
static unsigned char *tab_unshift, *tab_shift, *tab_caps;
|
||||||
static SDLKey keymap[ATARIBIOS_MAXKEYS];
|
static SDLKey keymap[ATARIBIOS_MAXKEYS];
|
||||||
|
|
||||||
static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysym);
|
static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysym,
|
||||||
|
SDL_bool pressed);
|
||||||
|
|
||||||
void AtariIkbd_InitOSKeymap(_THIS)
|
void AtariIkbd_InitOSKeymap(_THIS)
|
||||||
{
|
{
|
||||||
|
@ -171,13 +173,15 @@ void AtariIkbd_PumpEvents(_THIS)
|
||||||
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
||||||
/* Key pressed ? */
|
/* Key pressed ? */
|
||||||
if (SDL_AtariIkbd_keyboard[i]==KEY_PRESSED) {
|
if (SDL_AtariIkbd_keyboard[i]==KEY_PRESSED) {
|
||||||
SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(i, specialkeys, &keysym));
|
SDL_PrivateKeyboard(SDL_PRESSED,
|
||||||
|
TranslateKey(i, specialkeys, &keysym, SDL_TRUE));
|
||||||
SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
|
SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Key released ? */
|
/* Key released ? */
|
||||||
if (SDL_AtariIkbd_keyboard[i]==KEY_RELEASED) {
|
if (SDL_AtariIkbd_keyboard[i]==KEY_RELEASED) {
|
||||||
SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(i, specialkeys, &keysym));
|
SDL_PrivateKeyboard(SDL_RELEASED,
|
||||||
|
TranslateKey(i, specialkeys, &keysym, SDL_FALSE));
|
||||||
SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
|
SDL_AtariIkbd_keyboard[i]=KEY_UNDEFINED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -209,7 +213,8 @@ void AtariIkbd_PumpEvents(_THIS)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysym)
|
static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysym,
|
||||||
|
SDL_bool pressed)
|
||||||
{
|
{
|
||||||
unsigned char asciicode;
|
unsigned char asciicode;
|
||||||
|
|
||||||
|
@ -236,6 +241,9 @@ static SDL_keysym *TranslateKey(int scancode, int numkeytable, SDL_keysym *keysy
|
||||||
|
|
||||||
keysym->mod = KMOD_NONE;
|
keysym->mod = KMOD_NONE;
|
||||||
keysym->unicode = 0;
|
keysym->unicode = 0;
|
||||||
|
if (pressed && (asciicode!=0)) {
|
||||||
|
keysym->unicode = SDL_AtariToUnicode(asciicode);
|
||||||
|
}
|
||||||
|
|
||||||
return(keysym);
|
return(keysym);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ static char rcsid =
|
||||||
#include "SDL_gemvideo.h"
|
#include "SDL_gemvideo.h"
|
||||||
#include "SDL_gemevents_c.h"
|
#include "SDL_gemevents_c.h"
|
||||||
#include "SDL_atarikeys.h" /* for keyboard scancodes */
|
#include "SDL_atarikeys.h" /* for keyboard scancodes */
|
||||||
|
#include "SDL_atarievents_c.h"
|
||||||
#include "SDL_xbiosinterrupt_s.h"
|
#include "SDL_xbiosinterrupt_s.h"
|
||||||
|
|
||||||
/* Defines */
|
/* Defines */
|
||||||
|
@ -61,14 +62,16 @@ static SDLKey keymap[ATARIBIOS_MAXKEYS];
|
||||||
|
|
||||||
/* Functions prototypes */
|
/* Functions prototypes */
|
||||||
|
|
||||||
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym);
|
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
|
||||||
|
SDL_bool pressed);
|
||||||
static int do_messages(_THIS, short *message);
|
static int do_messages(_THIS, short *message);
|
||||||
static void do_keyboard(short kc, short ks);
|
static void do_keyboard(short kc, short ks);
|
||||||
static void do_mouse(_THIS, short mx, short my, short mb, short ks);
|
static void do_mouse(_THIS, short mx, short my, short mb, short ks);
|
||||||
|
|
||||||
/* Functions */
|
/* Functions */
|
||||||
|
|
||||||
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym)
|
static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym,
|
||||||
|
SDL_bool pressed)
|
||||||
{
|
{
|
||||||
/* Set the keysym information */
|
/* Set the keysym information */
|
||||||
keysym->scancode = scancode;
|
keysym->scancode = scancode;
|
||||||
|
@ -80,6 +83,9 @@ static SDL_keysym *TranslateKey(int scancode, int asciicode, SDL_keysym *keysym)
|
||||||
|
|
||||||
keysym->mod = KMOD_NONE;
|
keysym->mod = KMOD_NONE;
|
||||||
keysym->unicode = 0;
|
keysym->unicode = 0;
|
||||||
|
if (pressed && (asciicode!=0)) {
|
||||||
|
keysym->unicode = SDL_AtariToUnicode(asciicode);
|
||||||
|
}
|
||||||
|
|
||||||
return(keysym);
|
return(keysym);
|
||||||
}
|
}
|
||||||
|
@ -205,11 +211,13 @@ void GEM_PumpEvents(_THIS)
|
||||||
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
|
||||||
/* Key pressed ? */
|
/* Key pressed ? */
|
||||||
if (gem_currentkeyboard[i] && !gem_previouskeyboard[i])
|
if (gem_currentkeyboard[i] && !gem_previouskeyboard[i])
|
||||||
SDL_PrivateKeyboard(SDL_PRESSED, TranslateKey(i, gem_currentascii[i], &keysym));
|
SDL_PrivateKeyboard(SDL_PRESSED,
|
||||||
|
TranslateKey(i, gem_currentascii[i], &keysym, SDL_TRUE));
|
||||||
|
|
||||||
/* Key unpressed ? */
|
/* Key unpressed ? */
|
||||||
if (gem_previouskeyboard[i] && !gem_currentkeyboard[i])
|
if (gem_previouskeyboard[i] && !gem_currentkeyboard[i])
|
||||||
SDL_PrivateKeyboard(SDL_RELEASED, TranslateKey(i, gem_currentascii[i], &keysym));
|
SDL_PrivateKeyboard(SDL_RELEASED,
|
||||||
|
TranslateKey(i, gem_currentascii[i], &keysym, SDL_FALSE));
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(gem_previouskeyboard,gem_currentkeyboard,sizeof(gem_previouskeyboard));
|
memcpy(gem_previouskeyboard,gem_currentkeyboard,sizeof(gem_previouskeyboard));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue