[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2177.0. "How to find mouse pointer position?" by WPOMM2::ZAMBOTTI () Thu Feb 01 1990 00:10

Hi Xtechs,

thought I'de try something simple and came up against a brick wall.

How do you read/find the current value of the mouse/pointer within a window?

I looked thru all the likely routines and the closest I came to a solution
was the motion notify event or a button press event.  But this is not what I
want!

You see the application would like to know at any time where the mouse is
pointing (assuming that the mouse is over an application owned window) at
any time and not just when a mouse is clicked or the mouse is moved.

In other words I need to know where the mouse is even if it is doing nothing
and not creating any events.

Any ideas,

Walter Zambotti.
T.RTitleUserPersonal
Name
DateLines
2177.1XQueryPointerOPHION::MIKEYMike YangThu Feb 01 1990 01:163
    Use the Xlib routine XQueryPointer to find the pointer position
    whenever you want/need it.
    
2177.2Thankyou Very Much!WPOMM2::ZAMBOTTIThu Feb 01 1990 03:007
You wont believe how many times (or for how long) you can look in the the wrong
sections of the Xlib manual.

Much appreciated,


Walter.
2177.3Most applications should use event infoSDSVAX::SWEENEYPatrick Sweeney in New YorkThu Feb 01 1990 10:2712
    XQueryPointer generates a round-trip since the protocol request returns
    a reply and not an event, this is not the optimum case.
    
    Most applications should be satisfied to obtain the x and y of the
    pointer from the event data structure.
    
    The unusual case would be where the pointer location was being polled
    every n time units.
    
    An application that I was working on for Xlib=>XUI conversion actually
    put an XQueryPointer into its button press event handler routine.  So
    be careful.