[Top][All Lists]

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

Re: Why mouse-1/2/3 ?

From: Michael Welsh Duggan
Subject: Re: Why mouse-1/2/3 ?
Date: Mon, 27 Apr 2020 20:40:21 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

ndame <address@hidden> writes:

> I don't use the mouse in emacs at all, but when browsing info mouse-2
> caught my eye.
> Why emacs calls these mouse-1, 2 and 3? Wouldn't it be more user
> friendly to say left mouse button, middle mouse button and right mouse
> button?
> I checked what terminology Gnome uses:
> "Press the right mouse button on any local folder"
> https://help.gnome.org/users/shares-admin/stable/tool-getting-started.html.en_GB

It comes straight from X11 terminology.

1 = left
2 = middle
3 = right
4 = scroll wheel up
5 = scroll wheel down
6 = scroll wheel left (yes, really)
7 = scroll wheel right
8 = 4th button (browser back)
9 = 5th button (browser forward)

In point of fact, Emacs's first scroll-wheel support was on Windows.  I
know because I wrote it at the time.  (This was in the '96-'97
timeframe.  I didn't even have a mouse with a wheel at the time.  I had
to borrow a coworker's in order to test the code.)  At the time, I used
a new event, mouse-wheel, for the mouse-wheel event.  I don't know if
X11 supported a mouse wheel at this time.  Mainline (X11) emacs did not
need to change to support a mouse wheel once X11 had support for it: it
was just a new button number.  The symbol was just a concatenation of
"mouse-" and the button number.  Later work was done to unify NTEmacs
and mainline emacs, and the Windows-specific stuff changed to be more
like the X11 version.

One major advantage of the numbered naming system is listed above: the
code in emacs didn't need to change in the slightest when new buttons
were added.

Michael Welsh Duggan

reply via email to

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