unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: RE: C-u with mouse event is ignored?
Date: Sat, 8 Jan 2005 11:15:00 -0800	[thread overview]
Message-ID: <FDELKNEBLPKKDCEBEJCBGEAGCLAA.drew.adams@oracle.com> (raw)
In-Reply-To: <E1CnIbK-0006WC-JZ@fencepost.gnu.org>

        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	other threads:[~2005-01-08 19:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-07 18:03 C-u with mouse event is ignored? Drew Adams
2005-01-08 15:34 ` Richard Stallman
2005-01-08 19:15   ` Drew Adams [this message]
2005-01-09  0:03     ` Stefan
2005-01-09  0:36       ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=FDELKNEBLPKKDCEBEJCBGEAGCLAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).