emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mac emacs scroll bars


From: YAMAMOTO Mitsuharu
Subject: Re: Mac emacs scroll bars
Date: Fri, 09 Jul 2004 18:53:14 +0900
User-agent: Wanderlust/2.10.1 (Watching The Wheels) SEMI/1.14.5 (Awara-Onsen) FLIM/1.14.5 (Demachiyanagi) APEL/10.6 Emacs/21.3.50 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Thu, 8 Jul 2004 09:05:31 -0700, Steven Tamm <address@hidden> 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
                                address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]