40
$\begingroup$

The EventHandler documentation, More Information section, lists 5 mouse events:

"MouseClicked" "MouseDown" "MouseDragged" "MouseMoved" "MouseUp"

There is at least one other mouse event that can be used that is not listed in this documentation: "MouseEntered"

How can I find out all the possible arguments that can be used as events for EventHandler?

Edit

Also in this answer we learn of an undocumented option HandleShiftReturn which works as a "name" with MenuCommand. From the documentation:

{"MenuCommand","name"} menu command with specified name chosen

How do we find out all the possible "names"?

Edit #2 19th June

I got a reply from tech support. They state that "MouseEntered" and "MouseExited" in the GUI Kit are different from the ones in EventHandler and the ones in EventHandler are not yet ready for public use hence not documented. I didn't get an answer to my request for a full list of events for EventHandler (that are public).

Edit #3 30th June

Contacted tech support again after this question. Tech support advise that there is no (documented) way to use the shift, option, control, and function keys with EventHandler. Further they said there is no way to use key combinations with EventHandler. Still no closer to getting a complete list of events.

$\endgroup$
4
  • $\begingroup$ How did you find "MouseEntered"? $\endgroup$ Commented May 30, 2012 at 3:37
  • $\begingroup$ It was in the interactive balance sheet CDF example that Wolfram released. $\endgroup$ Commented May 30, 2012 at 4:10
  • $\begingroup$ There is also "MouseExited" (somewhere in MathematicaNavigator.nb) $\endgroup$
    – kglr
    Commented May 30, 2012 at 10:13
  • $\begingroup$ Now you can also look at the autocomplete list when you write CurrentValue[" and some starting letter $\endgroup$
    – Rojo
    Commented Feb 19, 2015 at 2:38

2 Answers 2

16
$\begingroup$

I haven't looked deeper into this but have you tried all the events which you can find in the documentation of GUIKit?

Especially here: GUIKit/ref/GUIInformation

The list at the bottom contains at least all events you have mentioned:

{"Action", "ActionPerformed", "Ancestor", "AncestorAdded", 
"AncestorMoved", "AncestorRemoved", "AncestorResized", 
"CaretPositionChanged", "Change", "Component", "ComponentAdded",
"ComponentHidden", "ComponentMoved", "ComponentRemoved",
"ComponentResized", "ComponentShown", "Container", "Focus",
"FocusGained", "FocusLost", "Hierarchy", "HierarchyBounds",
"HierarchyChanged", "InputMethod", "InputMethodTextChanged", "Item", 
"ItemStateChanged", "Key", "KeyPressed", "KeyReleased", "KeyTyped", 
"Mouse", "MouseClicked", "MouseDragged", "MouseEntered", 
"MouseExited", "MouseMotion", "MouseMoved", "MousePressed", 
"MouseReleased", "MouseWheel", "MouseWheelMoved", "PropertyChange", 
"StateChanged", "VetoableChange"}
$\endgroup$
2
  • $\begingroup$ I hadn't thought of this. $\endgroup$ Commented May 30, 2012 at 23:25
  • 1
    $\begingroup$ @MikeHoneychurch Any positive results while testing these? $\endgroup$
    – Kuba
    Commented Mar 23, 2014 at 9:54
9
$\begingroup$

So I scraped the internal files for whatever I could and this is what I got:

{
 "DownArrowKeyDown",
 "EscapeKeyDown",
 "LeftArrowKeyDown",
 "MouseClicked",
 "MouseDown",
 "MouseDragged",
 "MouseEntered",
 "MouseExited",
 "MouseMoved",
 "MouseUp",
 "ReturnKeyDown",
 "RightArrowKeyDown",
 "UpArrowKeyDown",
 "WindowClose",
 EvaluationOrder,
 PassEventsDown,
 PassEventsUp,
 {"KeyDown", "  "},
 {"KeyDown", "1"},
 {"KeyDown", "2"},
 {"KeyDown", "3"},
 {"KeyDown", "4"},
 {"KeyDown", "5"},
 {"KeyDown", "6"},
 {"MenuCommand", "CellTagsEditDialog"},
 {"MenuCommand", "CellTagsFind"},
 {"MenuCommand", "Close"},
 {"MenuCommand", "EvaluateCells"},
 {"MenuCommand", "EvaluateNextCell"},
 {"MenuCommand", "FindNextMatch"},
 {"MenuCommand", "FindPreviousMatch"},
 {"MenuCommand", "HandleShiftReturn"},
 {"MenuCommand", "New"},
 {"MenuCommand", "Open"},
 {"MenuCommand", "ScrollNotebookEnd"},
 {"MenuCommand", "ScrollNotebookStart"},
 {"MenuCommand", "ScrollPageDown"},
 {"MenuCommand", "ScrollPageUp"},
 {"MenuCommand", "SimilarCellBelow"},
 {"MouseClicked", 1}
 }

There's nor really anything wild here. A lot of menu commands, but usually those can be guess from a FrontEndToken name.

What is intriguing is that symbol EvaluationOrder. I do not know what it does, but I can tell you that it had the value Before. Here is the list of events it was paired with:

{
 "MouseDown" :> (CurrentValue[
     EvaluationNotebook[], {TaggingRules, "InputNotebook"}] = 
    InputNotebook[]; 
   SetOptions[EvaluationNotebook[], WindowClickSelect -> True]),
 PassEventsDown -> True,
 PassEventsUp -> True,
 EvaluationOrder -> Before
 }

Presumably figuring out what file it came from shouldn't be too hard, but I will take a stab at that some other time. I omitted the file names when I scraped the data and I'd need to run another scrape to get them.

EDIT

Ran that scrape. That particular handler is on some InputFields in

FileNameJoin@{$InstallationDirectory, "SystemFiles", "FrontEnd", 
  "Palettes", "NetworkGraphTools.nb"}
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.