[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] XaAES Bug in graf_mouse?



Hi,

I'm having trouble with a small GEM application, which is based on a event-loop (see example code). After the evnt_multi() call I determine if it was a mouse button event and then check for the mouse state in second loop. Under MagiC 6.01 everything works nicely: I can press any combination of mouse buttons. After releasing the buttons the loop is quit. Under XaAES the application gets stuck in the loop when I press both buttons at the same time.
=> Releasing the buttons doesn't leave the loop.

This happens under MiNT 1.16.x on Aranym (with latest XaAES from CVS) and on my Falcon under XaAES 0.992. Running MyAES over XaAES the problem doesn't appear. So it's probable that it's a bug in XaAES.

Is it a (known) bug?

Regards
Philipp

--------------------- example code -----------------------
#include <stdio.h>
#include <gem.h>

int main (int argc, const char * argv[])
{
short ap_id;
GRECT s={100,100, 200, 200};
short handle;
	ap_id=appl_init();
	
	handle = wind_create_grect(NAME|CLOSER, &s);
	wind_open_grect(handle, &s);
	
	int go_on = 1;
	do {
		short mx, my, mbutton, mclicks, kstate, key;
		short which;
		which = evnt_multi(MU_KEYBD|MU_BUTTON,
						   0x102, 3, 0,
						   0, 0, 0, 0, 0,
						   0, 0, 0, 0, 0,
						   NULL	,
						   0L,
						   &mx, &my, &mbutton, &kstate, &key, &mclicks);
		if(which & MU_KEYBD) {
			// quit when a key was pressed
			go_on = 0;
		}
		if(which & MU_BUTTON) {
			while(mbutton) {
				graf_mkstate(&mx, &my, &mbutton, &kstate);
				printf("x:%d y:%d clicks:%d button:%d KSTATE:%d\n",
					   mx, my, mclicks, mbutton, kstate);
			}
		}
		
	}while(go_on);
	
	wind_close(handle);
	wind_delete(handle);
	appl_exit();

	return 0;
}