From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: key bindings for mouse wheel Date: Fri, 22 Aug 2008 09:40:54 -0700 Message-ID: <001701c90475$d9030bb0$0200a8c0@us.oracle.com> References: <012f01c900cb$e9796d20$0200a8c0@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1219423533 23066 80.91.229.12 (22 Aug 2008 16:45:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Aug 2008 16:45:33 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 22 18:46:26 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KWZmE-0006bJ-OI for ged-emacs-devel@m.gmane.org; Fri, 22 Aug 2008 18:46:19 +0200 Original-Received: from localhost ([127.0.0.1]:47377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWZlH-0000v5-1N for ged-emacs-devel@m.gmane.org; Fri, 22 Aug 2008 12:45:19 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWZlD-0000up-2a for emacs-devel@gnu.org; Fri, 22 Aug 2008 12:45:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWZlB-0000uV-C1 for emacs-devel@gnu.org; Fri, 22 Aug 2008 12:45:14 -0400 Original-Received: from [199.232.76.173] (port=36072 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWZlB-0000uS-39 for emacs-devel@gnu.org; Fri, 22 Aug 2008 12:45:13 -0400 Original-Received: from rgminet01.oracle.com ([148.87.113.118]:34298) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KWZlA-0008Ow-Jo for emacs-devel@gnu.org; Fri, 22 Aug 2008 12:45:12 -0400 Original-Received: from agmgw1.us.oracle.com (agmgw1.us.oracle.com [152.68.180.212]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id m7MGj9uO002992 for ; Fri, 22 Aug 2008 10:45:10 -0600 Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by agmgw1.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id m7MCYonn025562 for ; Fri, 22 Aug 2008 10:42:06 -0600 Original-Received: from inet-141-146-46-1.oracle.com by acsmt357.oracle.com with ESMTP id 11649008511219423253; Fri, 22 Aug 2008 11:40:53 -0500 Original-Received: from dradamslap1 (/141.144.89.89) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 22 Aug 2008 09:40:53 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AckAy+kSq4KGn7ReRm+Li6zdX+lKYQDqUgPg X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 In-Reply-To: <012f01c900cb$e9796d20$0200a8c0@us.oracle.com> X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:102835 Archived-At: Resending. Does no one know whether `wheel-down' is platform independent and what the proper, portable way to bind mouse wheel events is? > From: Drew Adams Sent: Sunday, August 17, 2008 5:47 PM > I've been using bindings such as this: > > (define-key map [wheel-down] 'aaa) > (define-key map [wheel-down] 'bbb) > (define-key map [C-wheel-down] 'ccc) > (define-key map [C-wheel-down] 'ddd) > > Reading some mail on (I think) help-gnu-emacs got me a bit > confused however. It gave me the impression that such > bindings were only for MS Windows and that on > GNU/Linux `mouse-4' and `mouse-5' must be used instead of > `wheel-down' and `wheel-up'. (That sounds odd; I'd expect > `mouse-4' and `mouse-5' to be a fourth > and fifth mouse button, as they are on Windows.) > > I looked in the Elisp manual, but I didn't find anything specifically > recommending how one should bind mouse wheel events. I was > assuming that `wheel-down' was platform independent, but now > I have a doubt. > > The Elisp doc (node Misce Events) speaks about events such as > (wheel-up POSITION), but it doesn't speak about just what to > use when binding such keys. Further, it says that events such > as (wheel-up POSITION) are not generated on some systems and > that on those systems "`mouse-4' and `mouse-5' are used > instead". (Why is that?) > > It does say this, however: "For portable code, use the variables > `mouse-wheel-up-event' and `mouse-wheel-down-event'", and > then it goes on to say where those variables are defined (why?). > > So after a bit of fiddling I switched to this: > > (define-key map (vector mouse-wheel-down-event) 'aaa) > (define-key map (vector mouse-wheel-up-event) 'bbb) > (define-key map > (vector (list 'control mouse-wheel-down-event)) 'ccc) > (define-key map > (vector (list 'control mouse-wheel-up-event)) 'ddd) > > I haven't tested on GNU/Linux, but I'm assuming this is what > to use for portable code. Am I missing something? Is there a > shorter or better way to say this and still be portable? > > Does anyone else think: > > 1. There should be a shorter way to do this? > > 2. Or, if not, this should at least be documented clearly as > the way to bind mouse wheel events? > > [I would even expect the Emacs manual to tell you how to bind > mouse-wheel key sequences... But AFAICT the Emacs manual isn't > too helpful for even the basics about key binding. I'm > sending a separate mail about that.]