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: FW: key bindings for mouse wheel Date: Thu, 17 Sep 2009 15:48:57 -0700 Message-ID: <9832718F022E46F2992F0FF22DC5D3F0@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 1253227822 5557 80.91.229.12 (17 Sep 2009 22:50:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Sep 2009 22:50:22 +0000 (UTC) To: Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 18 00:50:15 2009 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 1MoPnq-0003hE-9O for ged-emacs-devel@m.gmane.org; Fri, 18 Sep 2009 00:50:14 +0200 Original-Received: from localhost ([127.0.0.1]:43856 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoPnp-0006tS-Kg for ged-emacs-devel@m.gmane.org; Thu, 17 Sep 2009 18:50:13 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MoPmj-0005zR-3L for emacs-devel@gnu.org; Thu, 17 Sep 2009 18:49:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MoPme-0005uO-Js for emacs-devel@gnu.org; Thu, 17 Sep 2009 18:49:04 -0400 Original-Received: from [199.232.76.173] (port=35197 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MoPme-0005u5-45 for emacs-devel@gnu.org; Thu, 17 Sep 2009 18:49:00 -0400 Original-Received: from acsinet11.oracle.com ([141.146.126.233]:31386) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MoPmd-0005br-J0 for emacs-devel@gnu.org; Thu, 17 Sep 2009 18:48:59 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n8HMo6ne028085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 17 Sep 2009 22:50:08 GMT Original-Received: from abhmt005.oracle.com (abhmt005.oracle.com [141.146.116.14]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n8HMmuRj005784 for ; Thu, 17 Sep 2009 22:48:56 GMT Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 17 Sep 2009 15:48:53 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AckAy+kSq4KGn7ReRm+Li6zdX+lKYQDqUgPgTNzsZGA= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt005.oracle.com [141.146.116.14] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090206.4AB2BCD6.00C1:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) 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:115445 Archived-At: Resending. -----------8<----------- From: Drew Adams Sent: Friday, August 22, 2008 9:41 AM 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.]