Mouse location input.

Mark Callow msc at ramoth.SGI.COM
Mon Apr 17 11:25:52 AEST 1989


In article <8904141229.AA24616 at explorer.dgp.toronto.edu>, juancho at dgp.toronto.edu (John Buchanan) writes:
> Is it possible to get mouse coordinates in window relative
> rather than in absolute screen coordinates?  The code that I have
> now looks like this.
> 
> 	switch(qread(&val))
> 		{
> 		case REDRAW:			/* Reset window offsets */
> 			getorigin(&xorg,&yorg);
> 			break;
> 		case LEFTMOUSE:			/* Get the mouse in window */
> 			X = getvaluator(MOUSEX) - xorg;
> 			Y = getvaluator(MOUSEY) - yorg;
> 			break;
> 		}
> 
> I cannot even imagine the thinking which led to the line drawing occuring
> in window coordinates but the mouse tracking only in screen coordinates.
> 

No thinking went into deciding it should be that way.  The
IRIS was originally developed without a window system and the input
system was designed in that environment.  What we have now is the result
of the great God compatibility.

I'm considering designing a new input subsystem.  I believe that input
should be given in your current coordinate system.  Send me your ideas.


--
	-Mark



More information about the Comp.sys.sgi mailing list