emacs-devel
[Top][All Lists]
Advanced

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

RE: mouse wheel events - why an extra <nil>?


From: Drew Adams
Subject: RE: mouse wheel events - why an extra <nil>?
Date: Thu, 7 Oct 2010 17:30:15 -0700

> >> (defcustom foo-keys (list [nil (control wheel-up)] ; A
> >>                           [(control wheel-up)])    ; B
> >>   "..." :type '(repeat sexp))
> >
> > Sorry, I should have used the variables instead of 
> > constants, so you can try it on non-Windows as well:
> 
> There is no wheel-up on non-Windows.

Correct.  Which is why I used the variables instead, in my followup mail that
you replied to.  You cut out that part of my mail, however - perhaps you did not
see it.  Here it is again:

(defcustom foo-keys
  (list (vector nil (list 'control mouse-wheel-down-event))  ; A
        (vector (list 'control mouse-wheel-down-event))) ; B
  "..." :type '(repeat sexp))

That is not Windows-specific code, unlike what I sent in my first msg.


BTW, I think now that the problem (bug, it seems) arises in particular when
using a standalone minibuffer frame.  My guess is that a frame-switch event or
something like that might somehow be polluting the wheel event that gets
returned, so that that event gets <nil> prepended to it somehow.  With a
standalone minibuffer frame this happens systematically, in the way I described
previously.

It is apparently not Windows-specific however.  A user of my code who does not
use a standalone minibuffer frame and does not use Windows said that he too saw
the error a couple of times: 

 "Some hours ago, I had an error message involving an mouse
  event starting with nil. I can't reproduce it. Never had it
  before, I think.

  [later] After 10 mins hardly trying to provoke it again, I had
  it one more time.  I pressed C-h k and got the message
  "<nil> <down-mouse-5> (translated from <down-mouse-5>) at
  that spot is undefined" with the mouse being over the echo
  area (of course, that's not the mb).  It's not reproducible.
  Maybe it is related to switching frames with the window manager."

On Windows the error message refers to "<nil> <C-wheel-down>".  On his platform
it refers to "<nil> <down-mouse-5>".  He does not have a standalone minibuffer
frame, which is why, I'm guessing, he does not see the error systematically.

I don't have more info than that about this.  Hopefully one of you will be able
to enlighten us all wrt the mysterious <nil> that appears here as part of a
mouse-wheel event but only in some circumstances.  As I mentioned, the doc and
Lisp code regarding the mouse wheel is not much help.





reply via email to

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