Article View: gnu.epoch.misc
Article #1687Re: Mouse double and triple click actions for Epoch 4.0
From: Heinz Schmidt
Date: Wed, 13 Nov 1991 00:48
Date: Wed, 13 Nov 1991 00:48
100 lines
5799 bytes
5799 bytes
Hi.
> We would like the following functionality from the Epoch mouse:
>
> double click - highlight current word
> triple click - highlight current line
The sky-mouse package supports multi-clicks. Among some other public
domain elisp files, you can retrieve the newest version from
AUS: lynx.csis.dit.csiro.au (world/elisp)
US: icsi-ftp.berkeley.edu (pub/elisp)
Sky-mouse works under various Emacsen and Epochs. The newest version
runs under Epoch 4 thanks to patches by Tom Emerson. CF. sky.README in
that directory for how to install it. I also recently changed some of
the other el files to use styles rather than the Epoch 3ish
attributes. For instance epoch-touchup.el is a rather small style
example that uses regular expression search to highlight things in a
different font.
Sky-mouse supports multi-click hints. Changing this to true
multi-click maps is desirable but was not possible under Epoch 3.
Multi-click *hints* means, commands are mapped independently of the
number of clicks and optionally read click-state (sort of mouse prefix
args).
The word, line, thing is supported this way. Extensions exist for
language modes, that allow fast selection of syntactic constructs
(if...end, etc; user doc in online mouse tutorial; programming example
in language-tools.el and sather-mode.el).
Under Epoch4 true timing info (event departure) is provided which was
not possible under Epoch3 (event handling time). There are a few of
other limitations, cf. the online documentation for more details. If
timeouts (in microseconds) and event snooping were supported in
Epoch4, a minor change of sky-mouse would allow a clean implementation
of the original multi-click hint idea: accumulation of multi-click
event sequences into a single multi-click event mapped to one command.
I've not yet found time to loock deeper into the Epoch 4 sources. If
the basic support is there, the mouse-handler macro could simply wait
a little while snooping incoming events, and, if any arrives in time,
increment multi-click-hint and give up to be called again. Otherwise
and finally it would map to the right command.
-- Heinz
------------------------------------------------------------------------
Heinz W. Schmidt ,--_|\ hws@csis.dit.csiro.au
CSIRO Division of Information Technology / \ tel (06) 275-0974
Australian National University, Canberra \_,--_*/ fax (06) 257-1052
v
PS: If you have sky-mouse installed, here is the patch to just
epoch-mouse-base.el that makes it work under Epoch4 (relative to the
May-91 version).
O\ /
O/ \ --------------------------------------------------------------------
pyxis 125> diff epoch-mouse-base.el epoch-mouse-base.el.~1~
17,20c17
< ;;;* Last edited: Nov 12 16:40 1991 (hws)
< ;;;* Nov 12 16:40 1991 (hws): adapt multi clicks to use "real" event time(stamp)
< ;;;* under Epoch 4
< ;;;* Nov 11 19:15 1991 (hws): integrated Tom Emerson's patch for Epoch4
---
> ;;;* Last edited: May 26 23:59 1991 (hws)
75,81d71
< ;;; Record the version of Epoch that we are running
< ;;; Make sure the code continues to run under Epoch version < 4 (hws)
< (defvar sky-epoch-3
< (and (> (length epoch::version) 6) ;;#+Epoch-3
< (string-equal (substring epoch::version 0 7)
< "Epoch 3")))
<
228,238d217
< ;;; This was hacked by Tree, 21.10.91 to work with Epoch4.0a1.
< ;;; Evidently we need to explicitly set the style to be used for
< ;;; underlining in epoch::mark-region. This seems to work.
< (defvar sky-region-style (epoch::make-style))
< (epoch::set-style-foreground sky-region-style (foreground))
< (epoch::set-style-background sky-region-style (background))
< (epoch::set-style-underline sky-region-style (foreground))
<
< ;;; Make sure the code continues to run under Epoch version < 4 (hws)
< (if sky-epoch-3 (setq sky-region-style 1))
<
247,250c226
< (setq drag-button
< (epoch::add-button from to
< sky-region-style
< nil))))
---
> (setq drag-button (epoch::add-button from to 1 nil))))
506,507c482
< ;; make timestamps visible for multi-click hints (hws)
< (let* (((, time) (if sky-epoch-3 (the-time) (aref epoch::event 3)))
---
> (let* (((, time) (the-time))
--
------------------------------------------------------------------------
Heinz W. Schmidt ,--_|\ hws@csis.dit.csiro.au
CSIRO Division of Information Technology / \ tel (06) 275-0974
Australian National University, Canberra \_,--_*/ fax (06) 257-1052
v
Technical Details
Message-ID:
<HWS.91Nov13104804@pyxis.csis.dit.csiro.au>Path:
arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!europa.asd.contel.com!darwin.sura.net!udel!wupost!spool.mu.edu!munnari.oz.au!manuel!csis!caroli!hwsReferences:
<anthony.689825016@citr.uq.oz.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc7ee,c5563e569f346d4e
X-Google-Attributes: gidfc7ee,public
X-Google-ArrivalTime: 1991-11-12 17:51:56 PST
Path: arc1-ca.pugleaf.net!gmdzi!zeus.ieee.org!europa.asd.contel.com!darwin.sura.net!udel!wupost!spool.mu.edu!munnari.oz.au!manuel!csis!caroli!hws
From: hws@pyxis.csis.dit.csiro.au (Heinz Schmidt)
Newsgroups: gnu.epoch.misc
Subject: Re: Mouse double and triple click actions for Epoch 4.0
Message-ID: <HWS.91Nov13104804@pyxis.csis.dit.csiro.au>
Date: 13 Nov 91 00:48:04 GMT
References: <anthony.689825016@citr.uq.oz.au>
Sender: news@csis.dit.csiro.au
Organization: /users/hws/.organization
Lines: 100
In-Reply-To: anthony@citr.uq.oz.au's message of Mon, 11 Nov 1991 02:03:36 GMT
Nntp-Posting-Host: pyxis.csis.dit.csiro.au
Cc: anthony@citr.uq.oz.au, gamin@ireq-robot.hydro.qc.ca,
Tom.Emerson@UVM.EDU, hws@csis.dit.csiro.au