src/video/ataricommon/SDL_gemdosevents.c
changeset 1420 2405517b5eab
parent 1402 d910939febfa
child 1662 782fd950bd46
child 1895 c121d94672cb
child 3854 f1816773a309
     1.1 --- a/src/video/ataricommon/SDL_gemdosevents.c	Thu Feb 23 04:16:08 2006 +0000
     1.2 +++ b/src/video/ataricommon/SDL_gemdosevents.c	Thu Feb 23 21:51:10 2006 +0000
     1.3 @@ -37,6 +37,7 @@
     1.4  #include "SDL_atarikeys.h"
     1.5  #include "SDL_atarievents_c.h"
     1.6  #include "SDL_xbiosevents_c.h"
     1.7 +#include "SDL_ataridevmouse_c.h"
     1.8  
     1.9  /* To save state of keyboard */
    1.10  #define ATARIBIOS_MAXKEYS 128
    1.11 @@ -44,6 +45,7 @@
    1.12  static unsigned char gemdos_currentkeyboard[ATARIBIOS_MAXKEYS];
    1.13  static unsigned char gemdos_previouskeyboard[ATARIBIOS_MAXKEYS];
    1.14  static unsigned char gemdos_currentascii[ATARIBIOS_MAXKEYS];
    1.15 +static SDL_bool use_dev_mouse = SDL_FALSE;
    1.16  
    1.17  /* Special keys state */
    1.18  enum {
    1.19 @@ -106,11 +108,15 @@
    1.20  	keymap[SCANCODE_LEFTALT] = SDLK_LALT;
    1.21  	keymap[SCANCODE_CAPSLOCK] = SDLK_CAPSLOCK;
    1.22  
    1.23 -	vectors_mask = ATARI_XBIOS_MOUSEEVENTS|ATARI_XBIOS_JOYSTICKEVENTS;
    1.24 +	use_dev_mouse = (SDL_AtariDevMouse_Open()!=0) ? SDL_TRUE : SDL_FALSE;
    1.25 +
    1.26 +	vectors_mask = ATARI_XBIOS_JOYSTICKEVENTS;	/* XBIOS joystick events */
    1.27 +	if (!use_dev_mouse) {
    1.28 +		vectors_mask |= ATARI_XBIOS_MOUSEEVENTS;	/* XBIOS mouse events */
    1.29 +	}
    1.30  	if (Getcookie(C_MiNT, &dummy)==C_FOUND) {
    1.31  		vectors_mask = 0;
    1.32  	}
    1.33 -
    1.34  	SDL_AtariXbios_InstallVectors(vectors_mask);
    1.35  }
    1.36  
    1.37 @@ -151,7 +157,11 @@
    1.38  				TranslateKey(i, gemdos_currentascii[i], &keysym, SDL_FALSE));
    1.39  	}
    1.40  
    1.41 -	SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
    1.42 +	if (use_dev_mouse) {
    1.43 +		SDL_AtariDevMouse_PostMouseEvents(this, SDL_TRUE);
    1.44 +	} else {
    1.45 +		SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
    1.46 +	}
    1.47  
    1.48  	/* Will be previous table */
    1.49  	SDL_memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard, ATARIBIOS_MAXKEYS);
    1.50 @@ -197,4 +207,7 @@
    1.51  void AtariGemdos_ShutdownEvents(void)
    1.52  {
    1.53  	SDL_AtariXbios_RestoreVectors();
    1.54 +	if (use_dev_mouse) {
    1.55 +		SDL_AtariDevMouse_Close();
    1.56 +	}
    1.57  }