unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jason Rumney <jasonr@gnu.org>
Cc: lennart.borgman.073@student.lu.se, emacs-devel@gnu.org
Subject: Re: commands invoked by the mouse -> commands invoked from the menu bar
Date: Sun, 14 May 2006 23:51:58 +0100	[thread overview]
Message-ID: <upsigz0c1.fsf@jasonrumney.net> (raw)
In-Reply-To: <ubqu11sls.fsf@jasonrumney.net> (Jason Rumney's message of "Sat, 13 May 2006 23:13:03 +0100")

Jason Rumney <jasonr@gnu.org> 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: <menu-bar> <file> <open-file>

    Using F10 and arrow keys to select the same menu item,
    view-lossage reports: <f10> <menu-bar> <file> <open-file>


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.

  parent reply	other threads:[~2006-05-14 22:51 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-13 16:14 commands invoked by the mouse -> commands invoked from the menu bar Lennart Borgman
2006-05-13 20:53 ` Luc Teirlinck
2006-05-13 22:13   ` Jason Rumney
2006-05-14  0:33     ` Lennart Borgman
2006-05-14 19:19       ` Jason Rumney
2006-05-14 15:09     ` Richard Stallman
2006-05-14 19:57       ` Jason Rumney
2006-05-14 22:51     ` Jason Rumney [this message]
2006-05-15  3:37       ` Luc Teirlinck
2006-05-15 20:34         ` Eli Zaretskii
2006-05-15 23:01           ` Luc Teirlinck
2006-05-16  3:27             ` Eli Zaretskii
2006-05-16  3:54               ` Luc Teirlinck
2006-05-16  5:49               ` Lennart Borgman
2006-05-16 17:44                 ` Eli Zaretskii
2006-05-14  0:47   ` Lennart Borgman
2006-05-14  1:01     ` Luc Teirlinck
2006-05-14 12:50       ` Lennart Borgman
2006-05-14 20:47         ` Luc Teirlinck
2006-05-14  2:39 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=upsigz0c1.fsf@jasonrumney.net \
    --to=jasonr@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=lennart.borgman.073@student.lu.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).