summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrice Mandin <patmandin@gmail.com>2012-11-04 19:07:49 +0100
committerPatrice Mandin <patmandin@gmail.com>2012-11-04 19:07:49 +0100
commit41db0efcba15220ca2d96c26836143b6b439f08b (patch)
treeee8fb09d7fb7a3d394d6cbbf2dd91bcebb48d562
parent1e5e68698fbdbd0e63213fb54d3741c6e536a35a (diff)
downloadsdl-41db0efcba15220ca2d96c26836143b6b439f08b.tar.gz
gem: revert back to graf_mkstate usage to get mouse state
-rw-r--r--src/video/gem/SDL_gemevents.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/src/video/gem/SDL_gemevents.c b/src/video/gem/SDL_gemevents.c
index 6b9a373b7..bff48cf08 100644
--- a/src/video/gem/SDL_gemevents.c
+++ b/src/video/gem/SDL_gemevents.c
@@ -87,25 +87,22 @@ void GEM_PumpEvents(_THIS)
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 @@ void GEM_PumpEvents(_THIS)
}
}
- /* 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 ? */