Function: menu-bar-open-mouse
menu-bar-open-mouse is an interactive and byte-compiled function
defined in menu-bar.el.gz.
Signature
(menu-bar-open-mouse EVENT)
Documentation
Open the menu bar for the menu item clicked on by the mouse.
EVENT should be a mouse down or click event.
Also see menu-bar-open, which this calls.
This command is to be used when you click the mouse in the menubar.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/menu-bar.el.gz
(defun menu-bar-open-mouse (event)
"Open the menu bar for the menu item clicked on by the mouse.
EVENT should be a mouse down or click event.
Also see `menu-bar-open', which this calls.
This command is to be used when you click the mouse in the menubar."
(interactive "e")
;; This only should be bound to clicks on the menu-bar, outside of
;; any window.
(let ((window (posn-window (event-start event))))
(when window
(error "Event is inside window %s" window)))
(let* ((x-position (car (posn-x-y (event-start event))))
(menu-bar-item-cons (menu-bar-item-at-x x-position)))
(menu-bar-open nil
(if menu-bar-item-cons
(cdr menu-bar-item-cons)
0))))