gem: revert back to graf_mkstate usage to get mouse state SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sun, 04 Nov 2012 19:07:49 +0100
branchSDL-1.2
changeset 6649 1aab0b09a0e3
parent 6648 5415ef59343a
child 6855 dbaee3350e32
gem: revert back to graf_mkstate usage to get mouse state
src/video/gem/SDL_gemevents.c
--- a/src/video/gem/SDL_gemevents.c	Sun Nov 04 19:02:21 2012 +0100
+++ b/src/video/gem/SDL_gemevents.c	Sun Nov 04 19:07:49 2012 +0100
@@ -87,25 +87,22 @@
 		quit = 0;
 
 		resultat = evnt_multi(
-			MU_MESAG|MU_TIMER|MU_KEYBD|MU_BUTTON|MU_M1,
-			0x101,7,prevmb,
-			MO_LEAVE,prevmx,prevmy,1,1,
+			MU_MESAG|MU_TIMER|MU_KEYBD,
+			0,0,0,
+			0,0,0,0,0,
 			0,0,0,0,0,
 			buffer,
 			10,
-			&mousex,&mousey,&mouseb,&kstate,&kc,&dummy
+			&dummy,&dummy,&dummy,&kstate,&kc,&dummy
 		);
 
 		/* Message event ? */
 		if (resultat & MU_MESAG)
 			quit = do_messages(this, buffer);
 
-		/* Special keys ? */
-		if (resultat & (MU_KEYBD|MU_BUTTON))
-			do_keyboard_special(kstate);
-
 		/* Keyboard event ? */
 		if (resultat & MU_KEYBD) {
+			do_keyboard_special(kstate);
 			if (prevkc != kc) {
 				do_keyboard(kc);
 				prevkc = kc;
@@ -115,24 +112,17 @@
 			}
 		}
 
-		/* Mouse motion event ? */
-		if (resultat & MU_M1) {
-			do_mouse_motion(this, mousex, mousey);
-			prevmx = mousex;
-			prevmy = mousey;
-		}
-
-		/* Mouse button event ? */
-		if (resultat & MU_BUTTON) {
-			do_mouse_buttons(this, mouseb);
-			prevmb = mouseb & 7;
-		}
-
 		/* Timer event ? */
 		if ((resultat & MU_TIMER) || quit)
 			break;
 	}
 
+	/* Update mouse state */
+	graf_mkstate(&mousex, &mousey, &mouseb, &kstate);
+	do_keyboard_special(kstate);
+	do_mouse_motion(this, mousex, mousey);
+	do_mouse_buttons(this, mouseb);
+
 	/* Now generate keyboard events */
 	for (i=0; i<ATARIBIOS_MAXKEYS; i++) {
 		/* Key pressed ? */