From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: Button that has different actions Date: Wed, 25 Dec 2013 09:14:11 -0800 (PST) Message-ID: <534d09ff-8e69-49e2-9251-bae3fcafbf47@default> References: <20131225085027.1ab82982@gauss> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1387991679 20543 80.91.229.3 (25 Dec 2013 17:14:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Dec 2013 17:14:39 +0000 (UTC) To: Joe Riel , Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Dec 25 18:14:45 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vvs2e-0006vj-9J for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Dec 2013 18:14:44 +0100 Original-Received: from localhost ([::1]:43036 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vvs2d-00077H-MG for geh-help-gnu-emacs@m.gmane.org; Wed, 25 Dec 2013 12:14:43 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44880) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vvs2L-00076r-CC for help-gnu-emacs@gnu.org; Wed, 25 Dec 2013 12:14:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vvs2C-0008OW-PB for help-gnu-emacs@gnu.org; Wed, 25 Dec 2013 12:14:25 -0500 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:22769) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vvs2C-0008OP-I3 for help-gnu-emacs@gnu.org; Wed, 25 Dec 2013 12:14:16 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id rBPHEFsp027628 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 25 Dec 2013 17:14:15 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rBPHEELs019736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 25 Dec 2013 17:14:14 GMT Original-Received: from ubhmt101.oracle.com (ubhmt101.oracle.com [156.151.24.6]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id rBPHEDsl019731; Wed, 25 Dec 2013 17:14:14 GMT In-Reply-To: <20131225085027.1ab82982@gauss> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6680.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:95157 Archived-At: > Can I create a button that has different > actions depending whether it was clicked with > mouse-1 or mouse-2? Or with a modifier key active? > The modifier might not be feasible because Emacs > already binds them with mouse clicks. The answer, unfortunately, is no, not easily/directly. Such things - allow for multiple actions, popup menu, etc. per button or tool-bar icon (e.g. via modifier keys) - was requested long ago, but never got anywhere. What you can perhaps do as a workaround is to bind a single command to a button click, and have that command test the event that lead to the command invocation and then dispatch different behaviors depending on the event characteristics.