Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!ispd-newsserver!ism.isc.com!ico!attc!marbru From: marbru@attc.UUCP (Martin Brunecky) Newsgroups: comp.windows.x Subject: Re: Using tablets in X (Was: Re: Moving pointer in software ?) Message-ID: <1295@attc.UUCP> Date: 25 Mar 91 16:02:39 GMT References: <9103131557.AA10051@devnull.Eng.Sun.COM> <1165@dandelion.CI.COM> <1991Mar18.170530.13580@dsd.es.com> <1276@attc.UUCP> <919@oliver.SUBLINK.ORG> Reply-To: marbru@auto-trol.UUCP (Martin Brunecky) Organization: Auto-trol Technology, Denver Lines: 52 In article <919@oliver.SUBLINK.ORG> newsuser@oliver.SUBLINK.ORG (Ugo Cei) writes: >You could also use a much more simple-minded approach: warp the >pointer when the stylus or the mouse on the digitizer moves. You could >create a program which reads the stylus position and outputs a couple >of coordinates whenever the position changes. Your application has to >open a connection to this program (e.g. using popen) and make the >server listen to it (via XtAddInput). Using XtAddInput to "make server listen to it" ??? I would more think of an independent program, communicating between the tablet and the server, running independently of the application. A simple tablet data collecting loop, generating XWarpPointer on a server connection. This would certainly do if the goal is only to move the pointer around, without any other application activity on the tablet (such as digitizing, menus, signature recognition ...). > >You also need to generate fake ButtonPress/Release events (via >XSendEvent) when the user presses/releases the stylus or mouse >button(s). If you send these events to the root window instead of your >application's main window, you can control the entire X session using >the digitizer, but beware that many applications require a three >button mouse to work properly and even some key+button combinations. >Also, when you stop moving the digitizer, you regain control of the >pointer through the mouse. Mhmmm. I have some experience in this field ... First of all, sending events to the root window did not work for me. I had to find the topmost window above the pointer interested in the button event (even propagate was giving me a headache), to deliver my sent-event to the proper window and application. (Not many applications request button events on the root window of the screen). Next, the real problem are grabs. On the true button down event, the server grabs the pointer (and releases it on button up). So far, I haven't found a way to simulate this one - not even talking about the fact that while the simulated button down is "active", the user can press the real button and confuse things even more. To summ it up, I have found that for many simple uses the "fake" button events do work. But not always. For example, window managers often do some magic on button downs (such as grabbing the server) - so performing (many of) WM functions through "fake" button events from the tablet simply does not work. I suspect that the "real" solution here is to use something like XTest extension - but it again falls into the pitthole of which server supports which extension .... -- =*= Opinions presented here are solely of my own and not those of Auto-trol =*= Martin Brunecky {...}sunpeaks!auto-trol!marbru (303) 252-2499 (sometimes also: marbru@auto-trol.COM ) Auto-trol Technology Corp. 12500 North Washington St., Denver, CO 80241-2404