emacs-devel
[Top][All Lists]
Advanced

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

RE: C-u with mouse event is ignored?


From: Drew Adams
Subject: RE: C-u with mouse event is ignored?
Date: Sat, 8 Jan 2005 11:15:00 -0800

        I'm probably missing something simple, but it looks like
        C-u followed by a mouse event is ignored.
        Is this by design or a bug?

I _was_ missing something. You can use `C-u' with mouse key sequences with
no problem. (You can also use it with menu key sequences, which are usually
accessed by mouse.)

It turns out that in the example I gave, `C-u' didn't work because of the
binding (global-set-key [S-down-mouse-1] 'ignore), which I used to get rid
of the default binding to `mouse-set-font'. It turns out that if you use,
instead, (global-set-key [S-down-mouse-1] nil) there is no problem - the
prefix arg is passed to function test.

IOW, the following works (the `C-u' arg is displayed correctly), but it does
not work with nil replaced by 'ignore:

 (defun test (arg) (interactive "P") (message "pref: %s" arg))
 (global-set-key [S-mouse-1] 'test)
 (global-set-key [S-down-mouse-1] nil) ; Get rid of `mouse-set-font'.

I suppose that this is because the `C-u' arg is passed to command `ignore',
rather than to command `test'. This didn't occur to me - this is the first
time I've noticed a difference between 'ignore and nil as a key binding (the
latter being actually an unbinding).

    I don't know, but it seems rather silly to use mouse clicks
    with keyboard arguments.

Why? because it requires using both keyboard and mouse? I use the mouse with
one hand and the keyboard with another all the time. Do you ever use Control
or Meta with a mouse button?

`C-u' might be a stretch for a single hand, depending on the keyboard, but
one can always bind `universal-argument' to a different key sequence that's
less of a stretch.





reply via email to

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