unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Subject: bug#6256: 24.0.50; read-event in `repeat' command
Date: Mon, 18 Oct 2010 21:13:19 -0400	[thread overview]
Message-ID: <jwvfww3ro05.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <7373B32B6D1648C2961BED0F625426FF@us.oracle.com> (Drew Adams's message of "Mon, 18 Oct 2010 14:12:30 -0700")

>> But that doesn't work either in my tests: the problem is that the
>> last-command-event was `mouse-4' (i.e. the up event) whereas 
>> read-event returns `down-mouse-4' (a subsequent read-event would
>> return the `mouse-4').

> No doubt that is a difference between Emacs on Windows and Emacs on GNU.

> BTW, the behavior you describe doesn't really seem very right for
> a mouse wheel: Why should the first wheel event be `down-'?

Under X11, wheel-up and wheel-down events are buttons, so they get
pressed&released like any other (actually, it seems to be the case for
the hardware as well, so it's not a complete invention of the X11
layer).  I.e. when you turn up the wheel by 3 steps, you get 6 events.

> I would think that `down-' would only be called for when you press the
> mouse wheel (as in mouse-2 clicking using the wheel).  Whatever.

You also get such a down in that case, but that's a down-mouse-2 rather
than a down-mouse-4 or down-mouse-5: pressing on the wheel is
a completely different button from "turning the wheel".

> Seems like the Emacs mouse-wheel behavior on Windows (the events) is
> generally superior to that on GNU.

Yes, tho it's mostly not Emacs's fault.  X11's handling of wheels is
not great.

> What about fixing the latter so that it comes up to speed?
> Another problem is that it precludes having `mouse-4' and `mouse-5'
> correspond to actual mouse buttons.

That's a general problem under X11, yes.  There are various ways to work
around the problem, but it's a source of annoyances.  Typically, the
additional buttons will then appear not as mouse-4/5 but for example as
mouse-6,7,8.

>> For my case, replacing the read-event by `read-key' happens to make
>> it work (see patch below).  Please confirm whether or not it fixes it
>> for you, and if it doesn't, please show me the values of
>> `repeat-repeat-char' and `evt' in the above test.
>> +	    (while (let ((evt (read-key)))
>> ;; For clicks, we need to strip the meta-data to
>> ;; check the underlying event name.
>> (eq (or (car-safe evt) evt)

> Yes, that works for me too.  Please install it if you see no problems
> with it.  Thx.

Thanks, it's installed in emacs-23, closed,


        Stefan





  reply	other threads:[~2010-10-19  1:13 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-24 15:11 bug#6256: 24.0.50; read-event in `repeat' command Drew Adams
2010-05-24 16:28 ` Drew Adams
2010-05-24 23:05   ` Drew Adams
2010-05-25  0:06     ` Lennart Borgman
2010-05-25  2:41     ` Stefan Monnier
2010-07-03 21:24       ` Drew Adams
2010-07-04 22:45         ` Stefan Monnier
2010-07-07 14:43           ` Drew Adams
2010-07-21 15:54           ` Drew Adams
2010-08-28 15:19             ` Drew Adams
2010-09-11 18:25         ` Stefan Monnier
2010-09-11 22:34           ` Drew Adams
2010-09-12 16:06             ` Drew Adams
2010-09-17  3:34               ` Drew Adams
2010-09-22 14:01                 ` bug#6256: [PATCH] " Drew Adams
2010-09-25 14:30                   ` Drew Adams
2010-10-18 18:40               ` Stefan Monnier
2010-10-18 21:12                 ` Drew Adams
2010-10-19  1:13                   ` Stefan Monnier [this message]
2010-10-19  6:50                     ` Jan Djärv
2010-10-19 14:03                       ` Drew Adams
     [not found]                 ` <jwv4ocjuvm1.fsf-monnier+emacs@gnu.org>
     [not found]                   ` <0658C0CCC79D466BA9DE233F5980CAE5@us.oracle.com>
     [not found]                     ` <jwvpqv7rp50.fsf-monnier+emacs@gnu.org>
2010-10-19 19:21                       ` Drew Adams
2010-10-19 20:54                         ` Stefan Monnier
2010-10-19 22:17                           ` Drew Adams
2010-10-20 15:47                             ` Stefan Monnier
2010-10-20 20:55                               ` Drew Adams
2010-10-21  1:08                                 ` Stefan Monnier
2010-10-22 18:43                                   ` Drew Adams
2010-10-22 19:47                                     ` Stefan Monnier

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=jwvfww3ro05.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=drew.adams@oracle.com \
    /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).