Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!udel!rochester!kodak!ispd-newsserver!ism.isc.com!b1!ico!auto-trol!marbru From: marbru@auto-trol.com (Martin Brunecky) Newsgroups: comp.windows.x Subject: Re: How to simulate mouse events from a data tablet Message-ID: <1991May30.022513.15790@auto-trol.com> Date: 30 May 91 02:25:13 GMT References: <1991May29.150652.20665@engage.pko.dec.com> Sender: news@auto-trol.com Distribution: usa Organization: Auto-trol Technology Corporation Lines: 48 Nntp-Posting-Host: server_1-gw In article <1991May29.150652.20665@engage.pko.dec.com> davis@3d.enet.dec.com (Peter Davis) writes: > >Gee, I'm trying to do almost this exact thing. I'm looking at a whole >bunch of input devices, and I want to be able to simulate mouse movements >by sending events, and then send any additional data that the devices can >input via the ClientMessage mechanism. > >To do motion, I found I had to: > > 1 XQueryPointer to get the current position, > 2 find the lowest offspring of the pointer window which still contains > the pointer position, > 3 XTranslateCoordinates to get the coordinates relative to that > offspring, > 4 XSendEvent to send a motion event to that window, > 5 XGrabPointer > 6 XWarpPointer > 7 XUngrabPointer ..... Can you elaborate on why you have to XGrabPointer ? (I don't, and have no problems I can see - so far). 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. > >To do button transitions, I had to: > ....(more of the same as above, without grabs - deleted)..... 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 .... -- =*= Opinions presented here are solely of my own and not those of Auto-trol =*= Martin Brunecky marbru%auto-trol@sunpeaks.central.sun.com (303) 252-2499 (better avoid: marbru@auto-trol.COM ) Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404