Skip to content

Commit

Permalink
Add flag to post mouse button events or not, and use defined function…
Browse files Browse the repository at this point in the history
… to post them
  • Loading branch information
pmandin committed Jan 31, 2006
1 parent 5bdff77 commit 3b06a36
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/video/ataricommon/SDL_biosevents.c
Expand Up @@ -153,7 +153,7 @@ void AtariBios_PumpEvents(_THIS)
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);
Expand Down
2 changes: 1 addition & 1 deletion src/video/ataricommon/SDL_gemdosevents.c
Expand Up @@ -158,7 +158,7 @@ void AtariGemdos_PumpEvents(_THIS)
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);
Expand Down
4 changes: 2 additions & 2 deletions src/video/ataricommon/SDL_xbiosevents.c
Expand Up @@ -122,7 +122,7 @@ static int atari_GetButton(int button)
}
}

void SDL_AtariXbios_PostMouseEvents(_THIS)
void SDL_AtariXbios_PostMouseEvents(_THIS, SDL_bool buttonEvents)
{
if (SDL_AtariXbios_enabled==0) {
return;
Expand All @@ -135,7 +135,7 @@ void SDL_AtariXbios_PostMouseEvents(_THIS)
}

/* Mouse button ? */
if (SDL_AtariXbios_mouseb != atari_prevmouseb) {
if (buttonEvents && (SDL_AtariXbios_mouseb != atari_prevmouseb)) {
int i;

for (i=0;i<2;i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/video/ataricommon/SDL_xbiosevents_c.h
Expand Up @@ -46,6 +46,6 @@ extern int SDL_AtariXbios_enabled;

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_ */
7 changes: 2 additions & 5 deletions src/video/gem/SDL_gemevents.c
Expand Up @@ -45,7 +45,7 @@ static char rcsid =
#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 */

Expand Down Expand Up @@ -383,10 +383,7 @@ static void do_mouse(_THIS, short mx, short my, short mb, short ks)

/* 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;
Expand Down

0 comments on commit 3b06a36

Please sign in to comment.