Path: utzoo!attcan!uunet!snorkelwacker!bloom-beacon!LARRY.MCRCIM.MCGILL.EDU!mouse From: mouse@LARRY.MCRCIM.MCGILL.EDU Newsgroups: comp.windows.x Subject: Re: Detecting a double-click Message-ID: <9009301901.AA20799@Larry.McRCIM.McGill.EDU> Date: 30 Sep 90 19:01:48 GMT Sender: root@athena.mit.edu (Wizard A. Root) Organization: The Internet Lines: 33 > Is there a general way to detect a double-click in a window ? No. > I want to be able to distinguish between 3 things the user can do. > a) Button press, drag and release. > b) Single click. > c) Double click. > Let's say I need to take actions A, B and C in the 3 cases, > respectively. Now, if I receive a click, I don't know whether it is > a single-click (and should perform action B) or the first click of a > double-click (and should perorm action C). That's right, you don't. X does not provide the tools to do proper double-click recognition; I am hoping that R5 will improve this. At present you have to either (i) make sure that action B can be undone or subsumed into action C or (ii) do the timing for double-click detection in the client and hope network delays don't bite you. There are many possible solutions, of varying degrees of generality and usefulness; the one I currently prefer is some way to ask the server to send a timeout event following each other event after some delay. Some of the variable factors would be what types of events timeouts can be requested for, how the timeout is specified (globally, per event type, per client, etc), what (if any) other events occurring in the interim will suppress the timeout event, etc. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu