From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.bugs Subject: Re: mouse wheel support in Emacs 21.3.50 Date: Sun, 24 Oct 2004 23:02:26 +0100 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1098655402 26304 80.91.229.6 (24 Oct 2004 22:03:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 24 Oct 2004 22:03:22 +0000 (UTC) Cc: bug-gnu-emacs@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 25 00:03:11 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CLqSF-0008CC-00 for ; Mon, 25 Oct 2004 00:03:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLqZr-000069-Cr for geb-bug-gnu-emacs@m.gmane.org; Sun, 24 Oct 2004 18:11:03 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CLqZo-00005g-Mp for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2004 18:11:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CLqZn-00004u-UN for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2004 18:11:00 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CLqZn-0008WQ-SS for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2004 18:10:59 -0400 Original-Received: from [194.106.33.237] (helo=outmail.freedom2surf.net) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CLqRk-0006dx-6d for bug-gnu-emacs@gnu.org; Sun, 24 Oct 2004 18:02:40 -0400 Original-Received: from wanchan.jasonrumney.net (i-195-137-77-250.freedom2surf.net [195.137.77.250]) by outmail.freedom2surf.net (8.12.10/8.12.10) with ESMTP id i9OM2cnF007043; Sun, 24 Oct 2004 23:02:38 +0100 Original-Received: from TONKOTSU-RAMEN (tonkotsu-ramen.jasonrumney.net [10.0.0.28]) by wanchan.jasonrumney.net (Postfix) with ESMTP id 90DAFDDD3A; Sun, 24 Oct 2004 23:02:38 +0100 (BST) Original-To: "Drew Adams" In-Reply-To: (Drew Adams's message of "Thu, 23 Sep 2004 23:17:46 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (windows-nt) X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:9434 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:9434 "Drew Adams" writes: > 1. Bug?: Searching Elisp Info for "wheel" shows nothing that is current. It > shows the same stuff as for Emacs 20 ("mouse-wheel"...). Yet, looking at > real mouse wheel events, I see stuff like wheel-up that is not in Info, and > I don't see "mouse-wheel" in real events. I have updated the elisp manual to reflect the current implementation. The rationale behind it was to separate out the wheel-up and wheel-down events to make it easier for end users to rebind them (the single mouse-wheel event was unusual in that you had to look at the DELTA parameter to see if it was positive or negative, most mouse and keyboard events are simpler). It also allowed us to reuse the mwheel implementation, which had some extra features that the previous Windows-only support did not have. > 3. I'd like to know how to interpret the components of the various mouse > events. In Emacs 20 this was simple; there was just the POSITION and the > DELTA. Now I see lots of components (with no Elisp Info) There is only POSITION (which like in the old mouse-wheel event is a list). > In particular, if I call read-event and get mouse wheel events, where > can I get the DELTA info that used to be there? That is where the double- and triple- modifiers come in, for compatibility with the mouse-4 and mouse-5 way of handling the mouse wheel. > Actually, I can pretty much see what's going on in mwheel-scroll, in terms > of getting the DELTA info (amount), but before I base new code on what > happens in (this 2002) mwheel-scroll code, I wonder if this is a good model; > that is, if this deals with the latest event structure and is the > recommended (i.e. current) way to go about things. I can't see this changing unless X gets proper mouse wheel support instead of emulating mouse-4 and -5. Unfortunately I think too many X applications now have mouse-4 and -5 hardcoded for that to change. One thing that could change is that mouse-4 and mouse-5 could be translated to wheel-up and wheel-down internally by Emacs, but because they come to Emacs as mouse button events, wheel-up and wheel-down will not be able to change I think (eg reintroducing DELTA). > And the whole treatment of the wheel as buttons 4 & 5 is not clear > to me. That is specific to X. On Windows and Mac, wheel-up and wheel-down are used. If you want to write portable code, use mouse-wheel-up-event and mouse-wheel-down-event to determine what events you should be dealing with. > And what if (as I do) I have 5 mouse buttons and a wheel? If you are on Windows or Mac, no problem, since the wheel has its own events. If you're on X, you'll have to map them to mouse-6 and mouse-7 or other applications will become confused (Emacs can be made to handle them as -4 and -5, with the wheel as -6 and -7, but other applications are not so flexible). > 5. Finally, although I have little real hope for this, are there any > guidelines for trying to make code that deals with making the mouse wheel > work in both Emacs 20 and 21? Since Emacs 20 had different mouse wheel handling for different platforms, such guidelines would be quite complex, as would your code for handling the differences. I've never heard of anyone using the mouse wheel in Emacs for anything other than its default scrolling behaviour, so I'm not sure there is any demand for such a guide.