[comp.sys.sgi] Bug in gl WRT tie

butler@BRL.MIL ("Lee A. Butler") (03/22/91)

It looks to me like the tie() facility does not function properly when used in
conjunction with a button on the dial/button box.

The 50 line program below demonstrates my problem. Once it is started, and the
mouse is positioned in the window which is opened, WITHOUT MOVING THE MOUSE,
I press and release the MOUSE2 button and then the SW1 button on the dial box.

The output results are as follows:

% tgl
User Dev: 534  value: 4
Mouse2 1
MouseX 202
MouseY 22
Mouse2 0
MouseX 202
MouseY 22
SW1 1
MouseX 202
MouseX 202
SW1 0
MouseX 202
MouseX 202
Mouse1 1

Yet I really did queue MOUSEX and MOUSEY to SW1, not 2 instances of MOUSEX.

----------------------- Program code ------------------------------------

#include <stdio.h>
#include <gl/device.h>

main()
{
	int win;
	short i=1;
	short dev, val;

	foreground();
	win = winopen("Bogosity Demo");

	qdevice(MOUSE1);

	qdevice(MOUSE2);
	tie(MOUSE2, MOUSEX, MOUSEY);

	qdevice(SW1);
	tie(SW1, MOUSEX, MOUSEY);

	while (i) 
			while (qtest()) {
				dev = qread(&val);
				switch (dev) {
				case SW1:
					printf("SW1 %d\n", val);
					break;
				case MOUSE1:
					printf("Mouse1 %d\n", val);
					i = 0;
					break;
				case MOUSE2:
					printf("Mouse2 %d\n", val);
					break;
				case MOUSEX:
					printf("MouseX %d\n", val);
					break;
				case MOUSEY:
					printf("MouseY %d\n", val);
					break;
				default:
					printf("User Dev: %d  value: %d\n",
						dev, val);
					break;
				}
			}


	return(0);
}

----------------------------------------------------------------------


For the curious, this was on a 4D/240 running 3.3


Lee A. Butler
SLCBR-VL-V					Internet: butler@brl.mil
Ballistic Research Laboratory			   Phone: (301) 278-9200
Aberdeen Proving Ground, MD 21005-5066

wiltse@oceana.esd.sgi.com (Wiltse Carpenter) (04/10/91)

The gl tie() operation is broken for devices other than the mouse in the 3.3 and
3.3.1 releases.  It is fixed, I think, in 3.3.2.  My apologies for introducing the bug
while adding qgetfd(), qcontrol(), and keywarp in the 3.3 release.

	-Wiltse Carpenter