changeset 1310:a201a8c62522

Add flag to post mouse button events or not, and use defined function to post them
author Patrice Mandin <patmandin@gmail.com>
date Tue, 31 Jan 2006 21:33:35 +0000
parents 0f00cbbe5792
children a557f907de1e
files 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
diffstat 5 files changed, 7 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/ataricommon/SDL_biosevents.c	Tue Jan 31 19:46:26 2006 +0000
+++ b/src/video/ataricommon/SDL_biosevents.c	Tue Jan 31 21:33:35 2006 +0000
@@ -153,7 +153,7 @@
 				TranslateKey(i, bios_currentascii[i], &keysym, SDL_FALSE));
 	}
 
-	SDL_AtariXbios_PostMouseEvents(this);
+	SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
 
 	/* Will be previous table */
 	memcpy(bios_previouskeyboard, bios_currentkeyboard, ATARIBIOS_MAXKEYS);
--- a/src/video/ataricommon/SDL_gemdosevents.c	Tue Jan 31 19:46:26 2006 +0000
+++ b/src/video/ataricommon/SDL_gemdosevents.c	Tue Jan 31 21:33:35 2006 +0000
@@ -158,7 +158,7 @@
 				TranslateKey(i, gemdos_currentascii[i], &keysym, SDL_FALSE));
 	}
 
-	SDL_AtariXbios_PostMouseEvents(this);
+	SDL_AtariXbios_PostMouseEvents(this, SDL_TRUE);
 
 	/* Will be previous table */
 	memcpy(gemdos_previouskeyboard, gemdos_currentkeyboard, ATARIBIOS_MAXKEYS);
--- a/src/video/ataricommon/SDL_xbiosevents.c	Tue Jan 31 19:46:26 2006 +0000
+++ b/src/video/ataricommon/SDL_xbiosevents.c	Tue Jan 31 21:33:35 2006 +0000
@@ -122,7 +122,7 @@
 	}
 }
 
-void SDL_AtariXbios_PostMouseEvents(_THIS)
+void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents)
 {
 	if (SDL_AtariXbios_enabled==0) {
 		return;
@@ -135,7 +135,7 @@
 	}
 	
 	/* Mouse button ? */
-	if (SDL_AtariXbios_mouseb != atari_prevmouseb) {
+	if (buttonEvents && (SDL_AtariXbios_mouseb != atari_prevmouseb)) {
 		int i;
 
 		for (i=0;i<2;i++) {
--- a/src/video/ataricommon/SDL_xbiosevents_c.h	Tue Jan 31 19:46:26 2006 +0000
+++ b/src/video/ataricommon/SDL_xbiosevents_c.h	Tue Jan 31 21:33:35 2006 +0000
@@ -46,6 +46,6 @@
 
 extern void SDL_AtariXbios_InstallVectors(int vectors_mask);
 extern void SDL_AtariXbios_RestoreVectors(void);
-extern void SDL_AtariXbios_PostMouseEvents(_THIS);
+extern void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents);
 
 #endif /* _SDL_XBIOSEVENTS_H_ */
--- a/src/video/gem/SDL_gemevents.c	Tue Jan 31 19:46:26 2006 +0000
+++ b/src/video/gem/SDL_gemevents.c	Tue Jan 31 21:33:35 2006 +0000
@@ -45,7 +45,7 @@
 #include "SDL_gemevents_c.h"
 #include "SDL_atarikeys.h"	/* for keyboard scancodes */
 #include "SDL_atarievents_c.h"
-#include "SDL_xbiosinterrupt_s.h"
+#include "SDL_xbiosevents_c.h"
 
 /* Defines */
 
@@ -383,10 +383,7 @@
 
 	/* Mouse motion ? */
 	if (GEM_mouse_relative) {
-		if (SDL_AtariXbios_mousex || SDL_AtariXbios_mousey) {
-			SDL_PrivateMouseMotion(0, 1, SDL_AtariXbios_mousex, SDL_AtariXbios_mousey);
-			SDL_AtariXbios_mousex = SDL_AtariXbios_mousey = 0;
-		}
+		SDL_AtariXbios_PostMouseEvents(this, SDL_FALSE);
 	} else {
 		if ((prevmousex!=mx) || (prevmousey!=my)) {
 			int posx, posy;