[Top][All Lists]

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

Re: Binding mouse key sequences

From: Michael Heerdegen
Subject: Re: Binding mouse key sequences
Date: Wed, 03 Jul 2013 02:16:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

greenwaters <> writes:

> I tried unsuccesfully to bind a sequence of two mouse keys. For example
> (global-set-key [mouse-8 mouse-9] 'write-file)
> after unsetting mouse-8 globally. Pressing mouse-8 gives a message "Empty
> menu" at the bottom of the screen.

Does this happen with emacs -Q (i.e., without loading your init file)?

What does C-h k mouse-8 tell you?  Does it even work when you do

  (global-set-key [mouse-8] 'write-file)


> Section 
> 48.3.10 Rebinding Mouse Buttons
> in the manual mentions, at the end, the possibility of binding mouse
> sequences.
> What is the right way to do this?

IMHO this is the right way.  If I eval

  (global-set-key [mouse-8 mouse-9] 'write-file)

and then

    (push 'mouse-9 unread-command-events)
    (push 'mouse-8 unread-command-events))

I get `write-file' called (sorry, I don't have a mouse with mouse-8 to
test, that's why I pushed events to `unread-command-events').

Are you sure Emacs is really receiving a mouse-8 event?

Also (setq debug-on-error t) should help you to see what's going on,
because you seem to get an error.



reply via email to

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