Newsgroups: comp.sys.sgi Path: utzoo!utgpu!jarvis.csri.toronto.edu!dgp.toronto.edu!juancho From: juancho@dgp.toronto.edu (John Buchanan) Subject: Mouse location input. Message-ID: <8904141229.AA24616@explorer.dgp.toronto.edu> Organization: University of Toronto, CSRI, DGP Is there any way to determine the location of a mouse relative to Date: Fri, 14 Apr 89 08:29:13 EDT a window 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. John W. Buchanan Dynamic Graphics Project Computer Systems Research Institute University of Toronto (416) 978-6619 Toronto, Ontario M5S 1A4 BITNET: juancho@explorer.dgp.utoronto EAN: juancho@explorer.dgp.toronto.cdn UUCP: ...!explorer.dgp.toronto.edu!juancho