all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Cc: Martin Otte <otte@duke.edu>, emacs-devel <emacs-devel@gnu.org>
Subject: Re: Mac emacs scroll bars
Date: Fri, 09 Jul 2004 18:53:14 +0900	[thread overview]
Message-ID: <wlu0whse0l.wl@church.math.s.chiba-u.ac.jp> (raw)
In-Reply-To: <A3217450-D0F8-11D8-A9B1-00039390AB82@mac.com>

>>>>> On Thu, 8 Jul 2004 09:05:31 -0700, Steven Tamm <steventamm@mac.com> said:

> I'm not sure one can do it at the lisp level. The particular problem
> is that holding down the mouse button doesn't generate the same kind
> of events on the mac that holding down a key would (i.e. autorepeat
> events).  Because of the event model, read-event hangs until you
> move the mouse.

One can tell whether an event has been available by examining the
return value of sit-for.  Here is an example:

(defun mac-scroll-down-line ()
  (track-mouse
    (let ((done nil)
	  event type)
      (while (not done)
	(scroll-down 1)
	(unless (sit-for mouse-delay) ;; possibly have initial and subsequent delays
	  (setq event (read-event))
	  (setq type (event-basic-type event))
	  (cond ((eq type 'mouse-1)
		 (setq done t))
		((eq type 'mouse-movement)
		 ;; should do something
		 )))))))

Maybe some subtle cases should be added to the above cond-expression.

> I checked in a change similar to this.  I forgot to add drag-mouse-1
> to the list of ignorable events, though.

Perhaps the following is simpler.  (I should have noticed that.)

(defun mac-scroll-ignore-events ()
  ;; Ignore confusing non-mouse events
  (while (not (eq (event-basic-type (read-event)) 'mouse-1))
    nil))

				     YAMAMOTO Mitsuharu
				mituharu@math.s.chiba-u.ac.jp

  reply	other threads:[~2004-07-09  9:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <7627C10A-CF84-11D8-8F92-00050260B859@duke.edu>
     [not found] ` <wl7jtety5y.wl@church.math.s.chiba-u.ac.jp>
2004-07-08 16:05   ` Mac emacs scroll bars Steven Tamm
2004-07-09  9:53     ` YAMAMOTO Mitsuharu [this message]
2004-07-09 15:27       ` Lennart Staflin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wlu0whse0l.wl@church.math.s.chiba-u.ac.jp \
    --to=mituharu@math.s.chiba-u.ac.jp \
    --cc=emacs-devel@gnu.org \
    --cc=otte@duke.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.