Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!nntpd.lkg.dec.com!engage!gauss.enet.dec.com!davis From: davis@gauss.enet.dec.com (Peter Davis) Newsgroups: comp.windows.x Subject: Re: How to simulate mouse events from a data tablet Message-ID: <1991May30.135144.5884@engage.pko.dec.com> Date: 30 May 91 13:44:05 GMT Sender: newsdaemon@engage.pko.dec.com (USENET News Daemon) Distribution: usa Organization: Digital Equipment Corporation Lines: 44 In article <1991May30.022513.15790@auto-trol.com>, marbru@auto-trol.com (Martin Brunecky) writes... > > Can you elaborate on why you have to XGrabPointer ? (I don't, and have > no problems I can see - so far). > I thought I had to grab the pointer in order to be able to move it around in windows outside my control. I don't remember testing this, however, so perhaps it's not necessary. > > Plus, I also found I have to look at what events those windows are > interested in. The "propagate" mechanism did not work for me, so I am > looking for the "topmost" window containing the pointer AND interested > in a particular event. > As far as I know, there's no way, or at least, no easy way to find out which window to send the events to. Using the lowest window containing the pointer seems to work most of the time, but not always. As I mentioned. I still don't have my code completely working yet, so I don't know all the ramifications. Maybe I should try your approach. > > I found I can easily send a button event. The problems arise when the > client receiving this button event either: > - assumes a passive grab > - grabs the button explicitly. > > For example, trying to resize window from a "simulated" mouse under > most widnow managers won't work - those guys grab the "real" mouse > button - which is not depressed. > Grabbing the pointer for motions might help, but I am worried it will > confuse other things .... > It may be that there's no way to really do this other than through some X extension, such as the input extension. This would require rebuilding the X server and possibly the operating system kernel as well, so it's not well suited for quick testing and prototyping of different input devices. I'd be interested in seeing what you're doing. If you want to exchange code, we can do it here or by mail. Thanks. -pd