unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* ignore mouse-wheel press during rotation
@ 2006-02-02 17:09 Drew Adams
  2006-02-02 21:21 ` Kim F. Storm
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Drew Adams @ 2006-02-02 17:09 UTC (permalink / raw)


This might be considered a bug fix request, but it is probably better seen
as feature request. It concerns mice that have a wheel that can be rotated
or pressed (e.g. clicked). In the latter case, the wheel is (usually?
always?) treated as mouse-2.

The problem (annoyance) is that with many (all?) such mice it is easy to
accidentally press the wheel while trying to rotate it (the rotation finger
movement ends similarly to a press movement). In Emacs, this results in a
rotation (wheel) event followed by a mouse-2 event, which is rarely what you
want. This can be disorienting for a gnubie (e.g. unexpected pasted text),
and it is anyway annoying for oldbies.

Note that this is less of a problem (nonexistent?) in other applications,
which do not use mouse-2 the way Emacs does. For example, you don't notice
this problem in common Web browsers because you generally use mouse-1, not
mouse-2, for clicking and press-dragging. Emacs makes heavy use of mouse-2,
so the problem arises more frequently.

It would be great to remove this annoyance. This could probably be done by
ignoring mouse-2 events during and shortly after wheel-rotation events. This
might mean something like the following:

1. Ignore mouse-2 events between two mouse wheel rotation events.

2. Ignore a mouse-2 event following a mouse wheel rotation event
   within some (configurable) duration.

Perhaps #1 is not necessary or desirable. #2 should be sufficient, I think
(but I'm not sure).

WDOT? Is this something that could be tackled before the release? If not,
could we put it on the to-do list for after the release?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-02 17:09 ignore mouse-wheel press during rotation Drew Adams
@ 2006-02-02 21:21 ` Kim F. Storm
  2006-02-02 22:55   ` Drew Adams
  2006-02-03 10:21   ` Jason Rumney
  2006-02-02 22:15 ` John Paul Wallington
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 24+ messages in thread
From: Kim F. Storm @ 2006-02-02 21:21 UTC (permalink / raw)
  Cc: Emacs-Devel

"Drew Adams" <drew.adams@oracle.com> writes:

> The problem (annoyance) is that with many (all?) such mice it is easy to
> accidentally press the wheel while trying to rotate it (the rotation finger
> movement ends similarly to a press movement). In Emacs, this results in a
> rotation (wheel) event followed by a mouse-2 event, which is rarely what you
> want. This can be disorienting for a gnubie (e.g. unexpected pasted text),
> and it is anyway annoying for oldbies.

This is already fixed (a long time ago) in the mwheel package used
with X (at least).

Perhaps you are on Windoze which IIRC has native mouse wheel support
but might not ignore mouse clicks while scrolling...  

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-02 17:09 ignore mouse-wheel press during rotation Drew Adams
  2006-02-02 21:21 ` Kim F. Storm
@ 2006-02-02 22:15 ` John Paul Wallington
  2006-02-03 10:20 ` Jason Rumney
  2006-02-03 16:13 ` Piet van Oostrum
  3 siblings, 0 replies; 24+ messages in thread
From: John Paul Wallington @ 2006-02-02 22:15 UTC (permalink / raw)
  Cc: emacs-devel

"Drew Adams" <drew.adams@oracle.com> writes:

> The problem (annoyance) is that with many (all?) such mice it is easy to
> accidentally press the wheel while trying to rotate it (the rotation finger
[...]
> WDOT? Is this something that could be tackled before the release? If not,
> could we put it on the to-do list for after the release?

That sounds like a cool feature that Kim added yonks ago (see
ChangeLog entry below).  It seems to work here.


2002-11-29  Kim F. Storm  <storm@cua.dk>

	* mwheel.el: Avoid accidental yanking of text while scrolling with
	the mouse wheel.  This adds a short period after each mouse wheel
	scroll event where a click on the mouse wheel button is ignored.
	(mouse-wheel-click-event, mouse-wheel-inhibit-click-time): New customs.
	(mouse-wheel-click-button, mwheel-inhibit-click-event-timer): New vars.
	(mwheel-inhibit-click-timeout,mwheel-filter-click-events): New defuns.
	(mwheel-scroll): Add mwheel-filter-click-events as pre-command-hook.
	Start mwheel-inhibit-click-event-timer with timeout handler
	mwheel-inhibit-click-timeout.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: ignore mouse-wheel press during rotation
  2006-02-02 21:21 ` Kim F. Storm
@ 2006-02-02 22:55   ` Drew Adams
  2006-02-02 23:50     ` Kim F. Storm
  2006-02-03 10:21   ` Jason Rumney
  1 sibling, 1 reply; 24+ messages in thread
From: Drew Adams @ 2006-02-02 22:55 UTC (permalink / raw)


    > The problem (annoyance) is that with many (all?) such mice it
    > is easy to
    > accidentally press the wheel while trying to rotate it (the
    > rotation finger
    > movement ends similarly to a press movement). In Emacs, this
    > results in a
    > rotation (wheel) event followed by a mouse-2 event, which is
    > rarely what you
    > want. This can be disorienting for a gnubie (e.g. unexpected
    > pasted text),
    > and it is anyway annoying for oldbies.

    This is already fixed (a long time ago) in the mwheel package used
    with X (at least).

Great. I didn't realize that.

    Perhaps you are on Windoze which IIRC has native mouse wheel support
    but might not ignore mouse clicks while scrolling...

Yes, I am on Windows; I should have made that clear.

"So, how about adding the fix to Emacs with native mouse-wheel support (e.g.
Windows) also?", he suggested with trepidation.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-02 22:55   ` Drew Adams
@ 2006-02-02 23:50     ` Kim F. Storm
  2006-02-03  0:03       ` Drew Adams
  0 siblings, 1 reply; 24+ messages in thread
From: Kim F. Storm @ 2006-02-02 23:50 UTC (permalink / raw)
  Cc: Emacs-Devel

"Drew Adams" <drew.adams@oracle.com> writes:

>     Perhaps you are on Windoze which IIRC has native mouse wheel support
>     but might not ignore mouse clicks while scrolling...
>
> Yes, I am on Windows; I should have made that clear.
>
> "So, how about adding the fix to Emacs with native mouse-wheel support (e.g.
> Windows) also?", he suggested with trepidation.

Problem is that "the fix" will be completely different, so somebody
need to write it ...

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: ignore mouse-wheel press during rotation
  2006-02-02 23:50     ` Kim F. Storm
@ 2006-02-03  0:03       ` Drew Adams
  2006-02-04 12:51         ` Eli Zaretskii
  0 siblings, 1 reply; 24+ messages in thread
From: Drew Adams @ 2006-02-03  0:03 UTC (permalink / raw)


    >     Perhaps you are on Windoze which IIRC has native mouse
    >     wheel support
    >     but might not ignore mouse clicks while scrolling...
    >
    > Yes, I am on Windows; I should have made that clear.
    >
    > "So, how about adding the fix to Emacs with native
    > mouse-wheel support (e.g. Windows) also?", he suggested
    > with trepidation.

    Problem is that "the fix" will be completely different, so somebody
    need to write it ...

Right. I figured that. But if this was something fixed for most platforms
way back in 2002, perhaps some Windows or mouse expert will bring Windows up
to date on this in 2006 ;-)?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-02 17:09 ignore mouse-wheel press during rotation Drew Adams
  2006-02-02 21:21 ` Kim F. Storm
  2006-02-02 22:15 ` John Paul Wallington
@ 2006-02-03 10:20 ` Jason Rumney
  2006-02-03 16:06   ` Drew Adams
                     ` (2 more replies)
  2006-02-03 16:13 ` Piet van Oostrum
  3 siblings, 3 replies; 24+ messages in thread
From: Jason Rumney @ 2006-02-03 10:20 UTC (permalink / raw)
  Cc: Emacs-Devel

Drew Adams wrote:
> The problem (annoyance) is that with many (all?) such mice it is easy to
> accidentally press the wheel while trying to rotate it (the rotation finger
> movement ends similarly to a press movement).
Actually, I find the opposite is true. It is relatively easy to avoid 
applying downward force while rotating, but due to the shape of the 
wheel and position of the finger, difficult to avoid an accidental 
scroll when the intention is to press the button.

I don't think this is something that can be easily solved by ignoring 
certain events, since it is impossible to know the user's real intention 
and we are as likely to frustrate the user as help them.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-02 21:21 ` Kim F. Storm
  2006-02-02 22:55   ` Drew Adams
@ 2006-02-03 10:21   ` Jason Rumney
  2006-02-03 15:57     ` Drew Adams
  2006-02-04 12:56     ` Eli Zaretskii
  1 sibling, 2 replies; 24+ messages in thread
From: Jason Rumney @ 2006-02-03 10:21 UTC (permalink / raw)
  Cc: Drew Adams, Emacs-Devel

Kim F. Storm wrote:
> "Drew Adams" <drew.adams@oracle.com> writes:
> This is already fixed (a long time ago) in the mwheel package used
> with X (at least).
>
> Perhaps you are on Windoze which IIRC has native mouse wheel support
> but might not ignore mouse clicks while scrolling...  
>   
Windows uses the code in mwheel.el. Only the names of the events are 
different, and this is taken care of
by variables in mwheel.el.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: ignore mouse-wheel press during rotation
  2006-02-03 10:21   ` Jason Rumney
@ 2006-02-03 15:57     ` Drew Adams
  2006-02-04  9:26       ` Eli Zaretskii
  2006-02-04 13:03       ` Eli Zaretskii
  2006-02-04 12:56     ` Eli Zaretskii
  1 sibling, 2 replies; 24+ messages in thread
From: Drew Adams @ 2006-02-03 15:57 UTC (permalink / raw)


    > This is already fixed (a long time ago) in the mwheel package used
    > with X (at least).
    >
    > Perhaps you are on Windoze which IIRC has native mouse wheel
    > support but might not ignore mouse clicks while scrolling...

    Windows uses the code in mwheel.el. Only the names of the events are
    different, and this is taken care of by variables in mwheel.el.

Be that as it may, this problem is not fixed in Windows, at least as of June
2005 CVS.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: ignore mouse-wheel press during rotation
  2006-02-03 10:20 ` Jason Rumney
@ 2006-02-03 16:06   ` Drew Adams
  2006-02-03 19:21   ` Eli Zaretskii
  2006-02-03 23:04   ` Stefan Monnier
  2 siblings, 0 replies; 24+ messages in thread
From: Drew Adams @ 2006-02-03 16:06 UTC (permalink / raw)


    > The problem (annoyance) is that with many (all?) such mice it
    > is easy to accidentally press the wheel while trying to
    > rotate it (the rotation finger
    > movement ends similarly to a press movement).

    Actually, I find the opposite is true. It is relatively easy to
    avoid applying downward force while rotating, but due to the
    shape of the wheel and position of the finger, difficult to
    avoid an accidental scroll when the intention is to press the
    button.

Perhaps it depends on the mouse - or the finger ;-). I've never accidentally
rotated when pressing, but I have accidentally pressed when rotating.

I don't know which problem Kim's fix solves - perhaps it solves both.

    I don't think this is something that can be easily solved by
    ignoring certain events, since it is impossible to know the
    user's real intention and we are as likely to frustrate the
    user as help them.

I don't know how it should be fixed. I really intended to describe the
problem, not the solution.

However, if it can be fixed for X then it can probably be fixed for Windows.
At least, the supposed obstacle of guessing the user's intention should not
be different in the two cases. If that were a significant problem for
Windows, it would also be significant for X.

People seem to be happy with the X fix, so similar behavior (if not similar
implementation) would likely be acceptable for Windows too.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-02 17:09 ignore mouse-wheel press during rotation Drew Adams
                   ` (2 preceding siblings ...)
  2006-02-03 10:20 ` Jason Rumney
@ 2006-02-03 16:13 ` Piet van Oostrum
  2006-02-03 22:16   ` Luc Teirlinck
  3 siblings, 1 reply; 24+ messages in thread
From: Piet van Oostrum @ 2006-02-03 16:13 UTC (permalink / raw)


>>>>> "Drew Adams" <drew.adams@oracle.com> (DA) wrote:

>DA> The problem (annoyance) is that with many (all?) such mice it is easy
>DA> to accidentally press the wheel while trying to rotate it (the
>DA> rotation finger movement ends similarly to a press movement). In
>DA> Emacs, this results in a rotation (wheel) event followed by a mouse-2
>DA> event, which is rarely what you want. This can be disorienting for a
>DA> gnubie (e.g. unexpected pasted text), and it is anyway annoying for
>DA> oldbies.

Actually, I have the opposite problem. I hardly use the mousewheel. I grew
up when mice didn't have wheels but heavily used the middle button. Now I
can't get a proper 3-button mouse anymore, and when I click the middle
button I often get unwanted wheel rotations. Maybe there should be a
variable telling what to do with simultaneous clicks and rotations.
-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet@vanoostrum.org

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03 10:20 ` Jason Rumney
  2006-02-03 16:06   ` Drew Adams
@ 2006-02-03 19:21   ` Eli Zaretskii
  2006-02-03 23:04   ` Stefan Monnier
  2 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2006-02-03 19:21 UTC (permalink / raw)
  Cc: drew.adams, emacs-devel

> Date: Fri, 03 Feb 2006 10:20:01 +0000
> From: Jason Rumney <jasonr@gnu.org>
> Cc: Emacs-Devel <emacs-devel@gnu.org>
> 
> I don't think this is something that can be easily solved by ignoring 
> certain events, since it is impossible to know the user's real intention 
> and we are as likely to frustrate the user as help them.

Right, and that's why my value of w32-swap-mouse-buttons is non-nil
since long ago.  That way, I don't need the wheel if I want mouse-2.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03 16:13 ` Piet van Oostrum
@ 2006-02-03 22:16   ` Luc Teirlinck
  2006-02-06 15:27     ` Piet van Oostrum
  0 siblings, 1 reply; 24+ messages in thread
From: Luc Teirlinck @ 2006-02-03 22:16 UTC (permalink / raw)
  Cc: emacs-devel

Piet van Oostrum wrote:

   Actually, I have the opposite problem. I hardly use the mousewheel. I grew
   up when mice didn't have wheels but heavily used the middle button. Now I
   can't get a proper 3-button mouse anymore, and when I click the middle
   button I often get unwanted wheel rotations. Maybe there should be a
   variable telling what to do with simultaneous clicks and rotations.

Assuming you do not want to use the mouse wheel at all, is it not
sufficient to turn off mouse-wheel-mode?  I can not check, because
with my setup, the mouse wheel never works in any application
whatsoever.  In particular, with my setup, it does not work in Emacs,
regardless of the value of mouse-wheel-mode.

Sincerely,

Luc.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03 10:20 ` Jason Rumney
  2006-02-03 16:06   ` Drew Adams
  2006-02-03 19:21   ` Eli Zaretskii
@ 2006-02-03 23:04   ` Stefan Monnier
  2006-02-04 13:06     ` Eli Zaretskii
  2 siblings, 1 reply; 24+ messages in thread
From: Stefan Monnier @ 2006-02-03 23:04 UTC (permalink / raw)
  Cc: Drew Adams, Emacs-Devel

> I don't think this is something that can be easily solved by ignoring
> certain events, since it is impossible to know the user's real intention and
> we are as likely to frustrate the user as help them.

We should probably just ignore mouse-[45] events while mouse-2 is pressed
(i.e. after down-mouse-2 but before the corresponding mouse-2).


        Stefan

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03 15:57     ` Drew Adams
@ 2006-02-04  9:26       ` Eli Zaretskii
  2006-02-04 13:03       ` Eli Zaretskii
  1 sibling, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2006-02-04  9:26 UTC (permalink / raw)
  Cc: emacs-devel

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Fri, 3 Feb 2006 07:57:57 -0800
> 
>     > This is already fixed (a long time ago) in the mwheel package used
>     > with X (at least).
>     >
>     > Perhaps you are on Windoze which IIRC has native mouse wheel
>     > support but might not ignore mouse clicks while scrolling...
> 
>     Windows uses the code in mwheel.el. Only the names of the events are
>     different, and this is taken care of by variables in mwheel.el.
> 
> Be that as it may, this problem is not fixed in Windows, at least as of June
> 2005 CVS.

Can you publish a recipe to reproduce this problem?  With that recipe,
please tell what mouse do you have and what does clicking on the wheel
do in Windows (look under Start->Settings->Control Panel->Mouse),
because the default action in Windows, at least with the IntelliPoint
mouse, is to switch to another frame, which normally prevents Emacs
from ever seeing the wheel click.

In other words, I couldn't reproduce your problem with the default
settings of the mouse.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03  0:03       ` Drew Adams
@ 2006-02-04 12:51         ` Eli Zaretskii
  0 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2006-02-04 12:51 UTC (permalink / raw)
  Cc: emacs-devel

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Thu, 2 Feb 2006 16:03:27 -0800
> 
>     >     Perhaps you are on Windoze which IIRC has native mouse
>     >     wheel support
>     >     but might not ignore mouse clicks while scrolling...
>     >
>     > Yes, I am on Windows; I should have made that clear.
>     >
>     > "So, how about adding the fix to Emacs with native
>     > mouse-wheel support (e.g. Windows) also?", he suggested
>     > with trepidation.
> 
>     Problem is that "the fix" will be completely different, so somebody
>     need to write it ...
> 
> Right. I figured that. But if this was something fixed for most platforms
> way back in 2002, perhaps some Windows or mouse expert will bring Windows up
> to date on this in 2006 ;-)?

It is _already_ up to date: as Jason points out, the Windows port uses
the same code in mwheel.el as the other ports.

I don't think what you see has anything to do with MS-Windows
specifics in Emacs, see my other mail in this thread.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03 10:21   ` Jason Rumney
  2006-02-03 15:57     ` Drew Adams
@ 2006-02-04 12:56     ` Eli Zaretskii
  2006-02-04 18:20       ` Drew Adams
  1 sibling, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2006-02-04 12:56 UTC (permalink / raw)
  Cc: emacs-devel, drew.adams, storm

> Date: Fri, 03 Feb 2006 10:21:55 +0000
> From: Jason Rumney <jasonr@gnu.org>
> Cc: Drew Adams <drew.adams@oracle.com>, Emacs-Devel <emacs-devel@gnu.org>
> 
> Kim F. Storm wrote:
> > "Drew Adams" <drew.adams@oracle.com> writes:
> > This is already fixed (a long time ago) in the mwheel package used
> > with X (at least).
> >
> > Perhaps you are on Windoze which IIRC has native mouse wheel support
> > but might not ignore mouse clicks while scrolling...  
> >   
> Windows uses the code in mwheel.el. Only the names of the events are 
> different, and this is taken care of
> by variables in mwheel.el.

Right, and indeed when I try this in today's CVS on Windows, I see no
problem at all.

Here's my recipe:

  . Start emacs -Q
  . Visit some file and copy something into the kill ring with "M-w"
  . Scroll down in the buffer by rotating the wheel, but apply
    pressure to the wheel, so that it clicks all the time during
    scrolling

I don't see any text being yanked during the scroll.  So it seems to
work as intended.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03 15:57     ` Drew Adams
  2006-02-04  9:26       ` Eli Zaretskii
@ 2006-02-04 13:03       ` Eli Zaretskii
  1 sibling, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2006-02-04 13:03 UTC (permalink / raw)
  Cc: emacs-devel

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Fri, 3 Feb 2006 07:57:57 -0800
> 
>     > This is already fixed (a long time ago) in the mwheel package used
>     > with X (at least).
>     >
>     > Perhaps you are on Windoze which IIRC has native mouse wheel
>     > support but might not ignore mouse clicks while scrolling...
> 
>     Windows uses the code in mwheel.el. Only the names of the events are
>     different, and this is taken care of by variables in mwheel.el.
> 
> Be that as it may, this problem is not fixed in Windows, at least as of June
> 2005 CVS.

Sorry, Drew, I don't believe you ;-)

There's nothing in ChangeLog between last June and today to suggest
that this behavior has changed since then.  And, as I wrote earlier in
this thread, on my Windows machine it works as intended, i.e. the
problem you seem to describe does not exist.  See the recipe I posted
a few minutes ago.

So the only way I can explain this discrepancy is if one or more of
the following are true:

  . You tried this in Emacs that isn't "emacs -Q", and some
    customizations you have there have some side effects on this;
  . You need to enlarge mouse-wheel-inhibit-click-time, because the
    default value is too small for your fingers;
  . You have customized your mouse via some Windows facilities so that
    clicking the wheel no longer produces the events that mwheel.el is
    programmed to handle.

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03 23:04   ` Stefan Monnier
@ 2006-02-04 13:06     ` Eli Zaretskii
  2006-02-04 16:52       ` Stefan Monnier
  0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2006-02-04 13:06 UTC (permalink / raw)
  Cc: emacs-devel, drew.adams, jasonr

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Fri, 03 Feb 2006 18:04:29 -0500
> Cc: Drew Adams <drew.adams@oracle.com>, Emacs-Devel <emacs-devel@gnu.org>
> 
> > I don't think this is something that can be easily solved by ignoring
> > certain events, since it is impossible to know the user's real intention and
> > we are as likely to frustrate the user as help them.
> 
> We should probably just ignore mouse-[45] events while mouse-2 is pressed
> (i.e. after down-mouse-2 but before the corresponding mouse-2).

You mean, to add the complementary code that ignores mouse-[45] after
mouse-2, like mouse-2 is now ignored after mouse-[45]?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-04 13:06     ` Eli Zaretskii
@ 2006-02-04 16:52       ` Stefan Monnier
  0 siblings, 0 replies; 24+ messages in thread
From: Stefan Monnier @ 2006-02-04 16:52 UTC (permalink / raw)
  Cc: emacs-devel, drew.adams, jasonr

>> > I don't think this is something that can be easily solved by ignoring
>> > certain events, since it is impossible to know the user's real
>> > intention and we are as likely to frustrate the user as help them.
>> 
>> We should probably just ignore mouse-[45] events while mouse-2 is pressed
>> (i.e. after down-mouse-2 but before the corresponding mouse-2).

> You mean, to add the complementary code that ignores mouse-[45] after
> mouse-2, like mouse-2 is now ignored after mouse-[45]?

Yes and no: the idea is similar, but I think a different implementation
should be used.

The current code ignores mouse-2 events if they occur shortly after
a mouse-wheel operation.

What I propose does not depend on time: mouse-wheel events should be ignored
for as long as mouse-2 is pressed.  In case you have a drag-like operation
bound to mouse-2 this can make a big difference.

After all, if the accidental mouse-wheel happens before down-mouse-2,
there's no way for us to ignore it (we can't know yet that a down-mouse-2
is coming and the current mwheel-inhibit-click code will actually decide to
ignore the down-mouse-2 event instead).

In my experience involontary wheel events don't happen when I release
the mouse-2 button, but if they do, then yes, maybe mouse-wheel events
should also be ignored for a little while after the mouse-2 release, just
like the current code does for mouse-2-after-mouse-wheel.


        Stefan

^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: ignore mouse-wheel press during rotation
  2006-02-04 12:56     ` Eli Zaretskii
@ 2006-02-04 18:20       ` Drew Adams
  2006-02-05  4:25         ` Eli Zaretskii
  0 siblings, 1 reply; 24+ messages in thread
From: Drew Adams @ 2006-02-04 18:20 UTC (permalink / raw)


      . Start emacs -Q
      . Visit some file and copy something into the kill ring with "M-w"
      . Scroll down in the buffer by rotating the wheel, but apply
        pressure to the wheel, so that it clicks all the time during
        scrolling

    I don't see any text being yanked during the scroll.  So it seems to
    work as intended.

The problem I mentioned was not about continuously applying pressure to the
wheel while rotating (something that my mouse even resists a bit, with
friction). I agree with you that there is no problem in that case.

The problem I raised was scrolling (without pressing), ending by
(accidentally) pressing the wheel (mouse-2). This is a problem for scrolling
up (so buffer text moves up), in particular, because the finger adduction
can also push the button down slightly.

1. emacs -q --no-site-file

2. Visit some file and copy something into the kill ring with `M-w'.

3. Scroll down in the buffer (scroll window up) by rotating the wheel,
without applying pressure to the wheel.

4. At the end of the wheel rotation, press the wheel (mouse-2).

IOW, rotation followed immediately by mouse-2 is the problem.

    please tell what mouse do you have and what does clicking on the wheel
    do in Windows (look under Start->Settings->Control Panel->Mouse),
    because the default action in Windows, at least with the IntelliPoint
    mouse, is to switch to another frame, which normally prevents Emacs
    from ever seeing the wheel click.

I have the same problem with different mice (work & home). The one I'm using
now is a Microsoft Intellimouse Explorer 3.0A, with no special
configuration. The other one I use is, I believe, a standard Dell PS2 mouse
with 2 buttons plus the wheel(button).

In the Mouse Properties dialog box, I have these settings. Nothing prevents
Emacs from seeing the wheel click - I know this, because I have debugged
Emacs-Lisp code and observed the mouse events during wheel rotation.

 . Left button = Click (default)
 . Right button = Right-click (default)
 . Wheel button = Next Window (default)

    So the only way I can explain this discrepancy is if one or more of
    the following are true:

      . You tried this in Emacs that isn't "emacs -Q", and some
        customizations you have there have some side effects on this;
No.
      . You need to enlarge mouse-wheel-inhibit-click-time, because the
        default value is too small for your fingers;

Thanks; that helps. I wasn't aware of that option. This indidates that there
is no special problem on Windows.

Question: Is it not the case that people only rarely intend to press (e.g.
click, to paste) mouse-2 directly after using the wheel? I can see why
someone might want to do that, and I recognize that both wheel rotation and
mouse-2 can be made to do other things in Emacs, besides scrolling and
pasting. But my guess is that wanting to rotate and then press mouse-2 is
rare. If so, then shouldn't `mouse-wheel-inhibit-click-time' be (much)
larger, by default? I tried 1 second, and that seemed pretty good.

      . You have customized your mouse via some Windows facilities so that
        clicking the wheel no longer produces the events that mwheel.el is
        programmed to handle.
No.

FWIW, I'm using GNU Emacs 22.0.50.1 (i386-mingw-nt5.1.2600)
of 2005-06-26 on NONIQPC
X server distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc
(3.3) --cflags -I../../jpeg-6b-3/include -I../../libpng-1.2.8/include -I../.
./tiff-3.6.1-2/include -I../../xpm-nox-4.2.0/include -I../../zlib-1.2.2/incl
ude'

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-04 18:20       ` Drew Adams
@ 2006-02-05  4:25         ` Eli Zaretskii
  2006-02-05 20:51           ` Kim F. Storm
  0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2006-02-05  4:25 UTC (permalink / raw)
  Cc: emacs-devel

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Sat, 4 Feb 2006 10:20:01 -0800
> 
> Question: Is it not the case that people only rarely intend to press (e.g.
> click, to paste) mouse-2 directly after using the wheel?

I don't see why this should be rare.  It's quite possible that a user
scrolls the buffer to find the correct place, then yanks some text in
that place.

> If so, then shouldn't `mouse-wheel-inhibit-click-time' be (much)
> larger, by default?

I don't know.  Kim, could you perhaps tell why you've chosen the
current default?

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-05  4:25         ` Eli Zaretskii
@ 2006-02-05 20:51           ` Kim F. Storm
  0 siblings, 0 replies; 24+ messages in thread
From: Kim F. Storm @ 2006-02-05 20:51 UTC (permalink / raw)
  Cc: Drew Adams, emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "Drew Adams" <drew.adams@oracle.com>
>> Date: Sat, 4 Feb 2006 10:20:01 -0800
>> 
>> Question: Is it not the case that people only rarely intend to press (e.g.
>> click, to paste) mouse-2 directly after using the wheel?
>
> I don't see why this should be rare.  It's quite possible that a user
> scrolls the buffer to find the correct place, then yanks some text in
> that place.
>
>> If so, then shouldn't `mouse-wheel-inhibit-click-time' be (much)
>> larger, by default?

5 minutes? 10 seconds?  How much larger do you think is reasonable?
Even 1 sec would be too much, IMO.

>
> I don't know.  Kim, could you perhaps tell why you've chosen the
> current default?

I don't remember, but probably I thought that 1/3 sec was a good
compromise between avoiding accidental yank vs. allowing user to yank
after scroll.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: ignore mouse-wheel press during rotation
  2006-02-03 22:16   ` Luc Teirlinck
@ 2006-02-06 15:27     ` Piet van Oostrum
  0 siblings, 0 replies; 24+ messages in thread
From: Piet van Oostrum @ 2006-02-06 15:27 UTC (permalink / raw)


>>>>> Luc Teirlinck <teirllm@dms.auburn.edu> (LT) wrote:

>LT> Piet van Oostrum wrote:
>LT>    Actually, I have the opposite problem. I hardly use the mousewheel. I grew
>LT>    up when mice didn't have wheels but heavily used the middle button. Now I
>LT>    can't get a proper 3-button mouse anymore, and when I click the middle
>LT>    button I often get unwanted wheel rotations. Maybe there should be a
>LT>    variable telling what to do with simultaneous clicks and rotations.

>LT> Assuming you do not want to use the mouse wheel at all, is it not
>LT> sufficient to turn off mouse-wheel-mode?  I can not check, because
>LT> with my setup, the mouse wheel never works in any application
>LT> whatsoever.  In particular, with my setup, it does not work in Emacs,
>LT> regardless of the value of mouse-wheel-mode.

Occasionally I might want to use the scroll wheel.
-- 
Piet van Oostrum <piet@cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet@vanoostrum.org

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2006-02-06 15:27 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-02 17:09 ignore mouse-wheel press during rotation Drew Adams
2006-02-02 21:21 ` Kim F. Storm
2006-02-02 22:55   ` Drew Adams
2006-02-02 23:50     ` Kim F. Storm
2006-02-03  0:03       ` Drew Adams
2006-02-04 12:51         ` Eli Zaretskii
2006-02-03 10:21   ` Jason Rumney
2006-02-03 15:57     ` Drew Adams
2006-02-04  9:26       ` Eli Zaretskii
2006-02-04 13:03       ` Eli Zaretskii
2006-02-04 12:56     ` Eli Zaretskii
2006-02-04 18:20       ` Drew Adams
2006-02-05  4:25         ` Eli Zaretskii
2006-02-05 20:51           ` Kim F. Storm
2006-02-02 22:15 ` John Paul Wallington
2006-02-03 10:20 ` Jason Rumney
2006-02-03 16:06   ` Drew Adams
2006-02-03 19:21   ` Eli Zaretskii
2006-02-03 23:04   ` Stefan Monnier
2006-02-04 13:06     ` Eli Zaretskii
2006-02-04 16:52       ` Stefan Monnier
2006-02-03 16:13 ` Piet van Oostrum
2006-02-03 22:16   ` Luc Teirlinck
2006-02-06 15:27     ` Piet van Oostrum

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).