Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mit-eddie!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: Substituting tablet for mouse Message-ID: <9012091744.AA15646@Larry.McRCIM.McGill.EDU> Date: 9 Dec 90 17:44:56 GMT Sender: daemon@athena.mit.edu (Mr Background) Organization: The Internet Lines: 40 > I'd like to be able to use a tablet with a pressure-sensitive stylus > in place of a mouse on my workstation. It will be difficult to do this with X. How do you propose to implement WarpPointer requests? Some mysterious force from the workstation grabs the stylus and shoves it over to where it's been warped to? I suppose if you're willing to yank the pointer back to where the stylus really is when a client warps it away, you could do this, but it seems contrary to the spirit of XWarpPointer() to do that. Not that that makes it illegal. > My goal is to have the tablet and stylus behave just like a mouse for > all unwitting applications, but to make it possible for my > applications to look for the pressure information in the event > structure, and use that. You're going to have to define a new event type. The current event structure does not have anywhere to put this information. You say > [Can I] cram the stylus pressure into the high two bytes of the > 'state' field in the motion event structure? The Xlib manual shows > this field as being unsigned int, and the most of the low order 16 > bits are defined as various button and modifier key masks. Can I I > use the high 16 bits for pressure? but the protocol uses a 16-bit field for this (check out the encoding in Appendix B). Expanding it by two more bytes would be an incompatible change and therefore is highly unlikely to happen. Your best bet, I would say, is to implement it as an extension. If no real pointer device is available, you could have it front for one, more or less ignoring warps (more precisely, warping right back again), but I'd consider that as a sort of desperation move. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu