From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: commands invoked by the mouse -> commands invoked from the menu bar Date: Sun, 14 May 2006 23:51:58 +0100 Message-ID: References: <446605F9.6020504@student.lu.se> <200605132053.k4DKrMo8006882@jane.dms.auburn.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1147647246 16209 80.91.229.2 (14 May 2006 22:54:06 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 14 May 2006 22:54:06 +0000 (UTC) Cc: lennart.borgman.073@student.lu.se, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 15 00:54:06 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FfPTJ-0001zl-LE for ged-emacs-devel@m.gmane.org; Mon, 15 May 2006 00:53:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FfPTJ-0000x0-4M for ged-emacs-devel@m.gmane.org; Sun, 14 May 2006 18:53:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FfPT6-0000vA-V5 for emacs-devel@gnu.org; Sun, 14 May 2006 18:53:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FfPT5-0000uU-12 for emacs-devel@gnu.org; Sun, 14 May 2006 18:53:44 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FfPT4-0000uR-T4 for emacs-devel@gnu.org; Sun, 14 May 2006 18:53:42 -0400 Original-Received: from [194.106.33.237] (helo=outmail.freedom2surf.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FfPVM-0005ol-8i for emacs-devel@gnu.org; Sun, 14 May 2006 18:56:04 -0400 Original-Received: from wanchan.jasonrumney.net (i-83-67-23-108.freedom2surf.net [83.67.23.108]) by outmail.freedom2surf.net (Postfix) with ESMTP id 545694C8F77; Sun, 14 May 2006 23:53:41 +0100 (BST) Original-Received: from TONKOTSU-RAMEN (tonkotsu-ramen.jasonrumney.net [10.0.0.28]) by wanchan.jasonrumney.net (Postfix) with ESMTP id 04BED64; Sun, 14 May 2006 23:53:40 +0100 (BST) Original-To: Luc Teirlinck In-Reply-To: (Jason Rumney's message of "Sat, 13 May 2006 23:13:03 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (windows-nt) 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:54465 Archived-At: Jason Rumney writes: > Perhaps menu events are being saved in last_nonmenu_event, at > least on Windows. In keyboard.c, I see the following comment. So the menu-bar event seems to be deliberately saved in last_nonmenu_event on all toolkit based builds. #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined(MAC_OS) \ || defined (USE_GTK) /* If this was a menu selection, then set the flag to inhibit writing to last_nonmenu_event. Don't do this if the event we're returning is (menu-bar), though; that indicates the beginning of the menu sequence, and we might as well leave that as the `event with parameters' for this selection. */ Although the comment says "we might as well leave that", it is actually quite important that we leave it on Windows and possibly with some or all of the other toolkits listed, since we do not see any events that are processed by the menu bar, including the mouse event that started the sequence. ie. Using the mouse to select the open-file menu item, view-lossage reports: Using F10 and arrow keys to select the same menu item, view-lossage reports: So unless we look at the event before the menu-bar event and check its binding (which may involve prior events - how do we tell when working backwards?) to see if it might have caused the menu to open, we cannot tell whether the mouse or keyboard was used.