Path: utzoo!dptcdc!jarvis.csri.toronto.edu!mailrus!ames!sgi!msc@ramoth.SGI.COM From: msc@ramoth.SGI.COM (Mark Callow) Newsgroups: comp.sys.sgi Subject: Re: Mouse location input. Message-ID: <30783@sgi.SGI.COM> Date: 17 Apr 89 01:25:52 GMT References: <8904141229.AA24616@explorer.dgp.toronto.edu> Sender: daemon@sgi.SGI.COM Organization: Silicon Graphics, Inc., Mountain View, CA Lines: 31 In article <8904141229.AA24616@explorer.dgp.toronto.edu>, juancho@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