Skip to content

Commit

Permalink
gem: revert back to graf_mkstate usage to get mouse state
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Nov 4, 2012
1 parent d73b6f3 commit 18a366d
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions src/video/gem/SDL_gemevents.c
Expand Up @@ -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;
Expand All @@ -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 ? */
Expand Down

0 comments on commit 18a366d

Please sign in to comment.