Article View: gnu.epoch.misc
Article #1112Re: Epoch mouse clicks broken; proposed fix
From: Brook Conner
Date: Thu, 14 Jan 1993 22:45
Date: Thu, 14 Jan 1993 22:45
74 lines
3800 bytes
3800 bytes
**> On Tue, 12 Jan 1993 22:53:00 GMT, piggy@hilbert.cc.utas.edu.au (La Monte Yarroll) said: piggy> I'm writing a user interface based on epoch in which I need to use piggy> multiple mouse clicks for alternate functionality. Great! piggy> If anyone has already solved this problem, I'd like to know--in any piggy> case I'll be coding my proposed solution today. Try looking in the various emacs lisp archives. The ones that have epoch code are likely to have epoch mouse handling for multiple clicks. IMOUSE is one such package that did useful stuf: one click to set point, doubleclick to select word, triple click to select sentence. Information on emacs lisp archives for epoch code can be found in the FAQ. Look for the faq tomorrow. piggy> I invite comments on this proposal. Counter-proposals are welcome. Here come some comments. piggy> Version: piggy> Epoch 4.2, mouse.el revision 1.12--multiple click detection piggy> based on code by Brian L. Kahn. piggy> BUG: piggy> Epoch calls the mouse handlers on each up and down click. It piggy> should only call an event handler once for a given type of piggy> click. I.e. a double click should not first call the code for piggy> a single click. Okay. To start with, I don't consider this a BUG. Nor, do I doubt, do the Epoch developers, or any number of people who have written mouse code for epoch. Or, for that matter, mouse code under _ANY_ reasonably modern user interface toolkit (e.g., Motif, XView, Athena, Garnet, Mac Toolkit, Windows, etc. etc.). Why is this not a bug? Well, let's look at your proposed solution: piggy> Proposed solution: piggy> Extra modifiers mouse-single-... mouse-quintuple-... will be piggy> added to the valid modifiers which can be passed to routines piggy> such as define-mouse. Note that this allows for notions such piggy> as mouse-double-down and mouse-triple-up. The default is to piggy> assume a single click. piggy> No mouse handler will be called until mouse-interval ms have piggy> elapsed since a mouse event has been reported by X. Alright, so there's a big problem: LAG. We're talking about lots of lag. Whenever you click the mouse button, epoch would always have to stall for mouse-interval ms, waiting to see if this click was really a double-click. This would make using epoch's mouse abilities feel like wading through putty. For example, suppose mouse-interval is an entire second. Every time you use the mouse, epoch would freeze for a second. [example code deleted] Wanting to do radically different things on single and double-clicks is generally a bad thing. I'd suggest looking at books on ui style (e.g., the Mac style guide) and considering what gets selected in a mac text field when you click some number of times. Brook -- Brook Conner | Klacktoveedsedstene Brown Computer Graphics | Fortune sez: Brook's Law -- Adding manpower to a late dbc@cs.brown.edu | software project makes it later uunet!brunix!dbc dbc@browncs.bitnet Box 1910 Brown U Prov RI 02912
Technical Details
Message-ID:
<DBC.93Jan14174554@hamlet.cs.brown.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!brunix!doorknob!dbcReferences:
<piggy.726879180@newsroom.utas.edu.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc7ee,e45441a5bc28a7d6 X-Google-Attributes: gidfc7ee,public X-Google-ArrivalTime: 1993-01-14 15:00:42 PST Newsgroups: gnu.epoch.misc Path: arc1-ca.pugleaf.net!sparky!uunet!brunix!doorknob!dbc From: dbc@cs.brown.edu (Brook Conner) Subject: Re: Epoch mouse clicks broken; proposed fix In-Reply-To: piggy@hilbert.cc.utas.edu.au's message of Tue, 12 Jan 1993 22:53:00 GMT Message-ID: <DBC.93Jan14174554@hamlet.cs.brown.edu> Sender: news@cs.brown.edu Organization: Department of Computer Science, Brown University References: <piggy.726879180@newsroom.utas.edu.au> Date: Thu, 14 Jan 1993 22:45:54 GMT Lines: 74