From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: Subject: w32 mouse wheel handling Date: Sun, 25 May 2003 11:19:53 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200305251519.h4PFJr5C014545@rum.cs.yale.edu> References: <25058549.1053701279594.JavaMail.www@wwinf0601> <871xynu0bo.fsf@cs.cmu.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1053876255 21238 80.91.224.249 (25 May 2003 15:24:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 25 May 2003 15:24:15 +0000 (UTC) Cc: emacs-devel Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sun May 25 17:24:10 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19JxM2-0005Vm-00 for ; Sun, 25 May 2003 17:24:10 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19JxYo-0007NE-00 for ; Sun, 25 May 2003 17:37:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19JxLH-0004oh-HQ for emacs-devel@quimby.gnus.org; Sun, 25 May 2003 11:23:23 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19JxK6-0004Cc-HP for emacs-devel@gnu.org; Sun, 25 May 2003 11:22:10 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19JxIF-0003ng-OP for emacs-devel@gnu.org; Sun, 25 May 2003 11:20:17 -0400 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19JxHw-0003Z9-1T for emacs-devel@gnu.org; Sun, 25 May 2003 11:19:56 -0400 Original-Received: from rum.cs.yale.edu (localhost [127.0.0.1]) by rum.cs.yale.edu (8.12.8/8.12.8) with ESMTP id h4PFJrx6014547; Sun, 25 May 2003 11:19:53 -0400 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.12.8/8.12.8/Submit) id h4PFJr5C014545; Sun, 25 May 2003 11:19:53 -0400 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: Michael Welsh Duggan Original-cc: david.ponce@wanadoo.fr X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:14236 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:14236 > > Another annoying thing with the way mouse wheel events are handled in > > NT Emacs, is that it is impossible to directly bind commands to scroll > > up or down events, nor to bind commands to mouse wheel events on the > > mode line or header line only, like in X. For example, I can't do > > something like this ;-) > > > > (global-set-key [mode-line mouse-4] 'mode-line-unbury-buffer) > > (global-set-key [mode-line mouse-5] 'mode-line-bury-buffer) > > > > I submit you the following patch to handle mouse wheel events in NT > > Emacs like in X, that is as mouse click events. Scrolling the wheel > > up produces mouse-4 events, and scrolling the wheel down produces > > mouse-5 events, eventually prefixed by header or mode line depending > > on the mouse location :-) > > > > Finally, handling all mouse events in an uniform way seems to have > > fixed the performance problem mentioned above :-) > > I would agree with this. When I wrote the original mouse wheel > support (now long since changed to better implementations), I created > the mouse-wheel event because (to the best of my knowlede, at the > time at least) these events hadn't been standardized into a > mouse-4/mouse-5 event at that time in X. I agree on the principle, but I think using mouse-4 and mouse-5 is not correct. It's just an X11 hack. I'd rather create new events like wheel-up and wheel-down and then have a function-key-map to translate mouse-4 and mouse-5 to wheel-up and wheel-down (on X). The only problem with it is that xterm-mouse-mode already uses the function-key-map to generate mouse-4 and mouse-5, so we'd have to change xterm-mouse-mode to manually pass its output through function-key-map. I don't know what mouse-wheel events look like under W32 (or under MacOS for that matter), so I'm not sure whether such an interface would be limiting. Stefan