From: ·······@ukpr.uky.edu
Subject: Reading double-click in Lispvew
Date: 
Message-ID: <1992Sep23.151359.1858@afterlife.ncsc.mil>
Quick question:  how can I set up code to execute when my program detects
a double click on the mouse.  The environment is Lispview on Sun computers.
Thanks
Matt Cutts    --- ·······@ukpr.uky.edu

From: David F. Skoll
Subject: Re: Reading double-click in Lispvew
Date: 
Message-ID: <dfs.717265495@sybok>
In <·····················@afterlife.ncsc.mil> ·······@ukpr.uky.edu writes:

>Quick question:  how can I set up code to execute when my program detects
>a double click on the mouse.  The environment is Lispview on Sun computers.

I've never used Lispview, so I'm guessing...

I assume you have a way to detect a single click.  What I did in an
application I wrote was, upon detection of a single click, record the
time of the click with (get-internal-real-time) in a slot of my data
structure.  If a second click arrived within *double-click-time* of
the previous click, I counted it as a double-click.

Hope that helps,

David F. Skoll
From: Richard Lynch
Subject: Re: Reading double-click in Lispvew
Date: 
Message-ID: <1992Sep23.191301.15146@ils.nwu.edu>
In article <·············@sybok> ···@doe.carleton.ca (David F. Skoll) writes:
>In <·····················@afterlife.ncsc.mil> ·······@ukpr.uky.edu writes:
>
>>Quick question:  how can I set up code to execute when my program detects
>>a double click on the mouse.  The environment is Lispview on Sun computers.
>
>I've never used Lispview, so I'm guessing...
>
>I assume you have a way to detect a single click.  What I did in an
>application I wrote was, upon detection of a single click, record the
>time of the click with (get-internal-real-time) in a slot of my data
>structure.  If a second click arrived within *double-click-time* of
>the previous click, I counted it as a double-click.

FWIW, one may wish to also record the exact position of the mouse and apply
a square-distance function to be sure the mouse has not moved significantly.
MAC hardware/software does this as a part of its standard of user-interface
guidelines.
The theory is that a double-click with more than (2 2) distance between clicks
probably wasn't meant to be a double-click at all.

-- 
"TANSTAAFL"     ·····@aristotle.ils.nwu.edu
From: Len Charest
Subject: Re: Reading double-click in Lispvew
Date: 
Message-ID: <1992Sep23.210142.6018@jpl-devvax.jpl.nasa.gov>
In article <·····················@afterlife.ncsc.mil>, ·······@ukpr.uky.edu writes:
|> Quick question:  how can I set up code to execute when my program detects
|> a double click on the mouse.  The environment is Lispview on Sun computers.

If you don't have the LispView docs then you should get them now. They are
publicly available at export.lcs.mit.edu in the directory /contrib/lispview1.1.

User actions (e.g., mouse clicks) are represented in LispView as 'events'. A
LispView object receives events by first expressing an 'interest'  in events of
some specific type. A method on the generic function RECEIVE-EVENT can then be
used to process the 'interesting' events. You can specialize RECEIVE-EVENT on any
class that is a subclass of CANVAS.

The following example shows how to capture mouse double clicks in a window named
*WIN*. Relevant information in the "LispView 1.1 Programming Manual - Beta
Release" begins on page 83.

(defvar *win* (make-instance 'lv:base-window))

;;; create a subclass of mouse-interest for
;;; unmodified double-clicks on the left button
(defclass left-double-click (lv:mouse-interest)
  ()
  (:default-initargs
   :event-spec '(() (:left :click2))))

;;; express interest in left-double-click mouse events
(push (make-instance 'left-double-click)
      (lv:interests *win*))

;;; custom code for handling double-click mouse events
;;; on *win*
(defmethod lv:receive-event ((canvas (eql *win*))
			     (interest left-double-click)
			     event)
  ;;simply provide some user feedback
  (format t "~&Mouse gesture ~s on canvas ~s"
	  (multiple-value-list (lv:mouse-event-gesture event))
	  canvas))

..................................................
                                  Len Charest, Jr.
                 JPL Artificial Intelligence Group
                          ·······@aig.jpl.nasa.gov