Add flag to post mouse button events or not, and use defined function to post them
authorPatrice Mandin <patmandin@gmail.com>
Tue, 31 Jan 2006 21:33:35 +0000
changeset 1310a201a8c62522
parent 1309 0f00cbbe5792
child 1311 a557f907de1e
Add flag to post mouse button events or not, and use defined function to post them
src/video/ataricommon/SDL_biosevents.c
src/video/ataricommon/SDL_gemdosevents.c
src/video/ataricommon/SDL_xbiosevents.c
src/video/ataricommon/SDL_xbiosevents_c.h
src/video/gem/SDL_gemevents.c
     1.1 --- a/src/video/ataricommon/SDL_biosevents.c	Tue Jan 31 19:46:26 2006 +0000
     1.2 +++ b/src/video/ataricommon/SDL_biosevents.c	Tue Jan 31 21:33:35 2006 +0000
     1.3 @@ -153,7 +153,7 @@
     1.4  				TranslateKey(i, bios_currentascii[i], &keysym, SDL_FALSE));
     1.5  	}
     1.6  
     1.7 -	SDL_AtariXbios_PostMouseEvents(this);
     1.8 +	SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
     1.9  
    1.10  	/* Will be previous table */
    1.11  	memcpy(bios_previouskeyboard, bios_currentkeyboard, ATARIBIOS_MAXKEYS);
     2.1 --- a/src/video/ataricommon/SDL_gemdosevents.c	Tue Jan 31 19:46:26 2006 +0000
     2.2 +++ b/src/video/ataricommon/SDL_gemdosevents.c	Tue Jan 31 21:33:35 2006 +0000
     2.3 @@ -158,7 +158,7 @@
     2.4  				TranslateKey(i, gemdos_currentascii[i], &keysym, SDL_FALSE));
     2.5  	}
     2.6  
     2.7 -	SDL_AtariXbios_PostMouseEvents(this);
     2.8 +	SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
     2.9  
    2.10  	/* Will be previous table */
    2.11  	memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard, ATARIBIOS_MAXKEYS);
     3.1 --- a/src/video/ataricommon/SDL_xbiosevents.c	Tue Jan 31 19:46:26 2006 +0000
     3.2 +++ b/src/video/ataricommon/SDL_xbiosevents.c	Tue Jan 31 21:33:35 2006 +0000
     3.3 @@ -122,7 +122,7 @@
     3.4  	}
     3.5  }
     3.6  
     3.7 -void SDL_AtariXbios_PostMouseEvents(_THIS)
     3.8 +void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents)
     3.9  {
    3.10  	if (SDL_AtariXbios_enabled==0) {
    3.11  		return;
    3.12 @@ -135,7 +135,7 @@
    3.13  	}
    3.14  	
    3.15  	/* Mouse button ? */
    3.16 -	if (SDL_AtariXbios_mouseb != atari_prevmouseb) {
    3.17 +	if (buttonEvents && (SDL_AtariXbios_mouseb != atari_prevmouseb)) {
    3.18  		int i;
    3.19  
    3.20  		for (i=0;i<2;i++) {
     4.1 --- a/src/video/ataricommon/SDL_xbiosevents_c.h	Tue Jan 31 19:46:26 2006 +0000
     4.2 +++ b/src/video/ataricommon/SDL_xbiosevents_c.h	Tue Jan 31 21:33:35 2006 +0000
     4.3 @@ -46,6 +46,6 @@
     4.4  
     4.5  extern void SDL_AtariXbios_InstallVectors(int vectors_mask);
     4.6  extern void SDL_AtariXbios_RestoreVectors(void);
     4.7 -extern void SDL_AtariXbios_PostMouseEvents(_THIS);
     4.8 +extern void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents);
     4.9  
    4.10  #endif /* _SDL_XBIOSEVENTS_H_ */
     5.1 --- a/src/video/gem/SDL_gemevents.c	Tue Jan 31 19:46:26 2006 +0000
     5.2 +++ b/src/video/gem/SDL_gemevents.c	Tue Jan 31 21:33:35 2006 +0000
     5.3 @@ -45,7 +45,7 @@
     5.4  #include "SDL_gemevents_c.h"
     5.5  #include "SDL_atarikeys.h"	/* for keyboard scancodes */
     5.6  #include "SDL_atarievents_c.h"
     5.7 -#include "SDL_xbiosinterrupt_s.h"
     5.8 +#include "SDL_xbiosevents_c.h"
     5.9  
    5.10  /* Defines */
    5.11  
    5.12 @@ -383,10 +383,7 @@
    5.13  
    5.14  	/* Mouse motion ? */
    5.15  	if (GEM_mouse_relative) {
    5.16 -		if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
    5.17 -			SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
    5.18 -			SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
    5.19 -		}
    5.20 +		SDL_AtariXbios_PostMouseEvents(this, SDL_FALSE);
    5.21  	} else {
    5.22  		if ((prevmousex!=mx) || (prevmousey!=my)) {
    5.23  			int posx, posy;