emacs-devel
[Top][All Lists]
Advanced

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

RE: Why mouse-1/2/3 ?


From: Drew Adams
Subject: RE: Why mouse-1/2/3 ?
Date: Tue, 28 Apr 2020 08:27:20 -0700 (PDT)

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

Excellent.  Thanks for reporting this, as the logic
behind this and as history.



reply via email to

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