Variable: last-nonmenu-event
last-nonmenu-event is a variable defined in keyboard.c.
Value
nil
Documentation
Last input event in a command, except for mouse menu events.
Mouse menus give back keys that don't look like mouse events; this variable holds the actual mouse event that led to the menu, so that you can determine whether the command was run by mouse or not.
Probably introduced at or before Emacs version 19.23.
Source Code
// Defined in /usr/src/emacs/src/keyboard.c
DEFVAR_LISP ("last-nonmenu-event", last_nonmenu_event,
doc: /* Last input event in a command, except for mouse menu events.
Mouse menus give back keys that don't look like mouse events;
this variable holds the actual mouse event that led to the menu,
so that you can determine whether the command was run by mouse or not. */);