Hi. Attached you will find an example script that uses mousebox.
Mousebox is very useful for interactive graphics, however, some of the functionality is not very well documented.
You do need to use mousebox if you are willing to click on a button.
This script runs a task when the home key on the keypad is clicked. A couple things to note about Mousebox, you can only specify one display box for the mousebox argument. However, if you make it a container display box, like VListBox, or HListBox, then multiple objects can be accessed via mousebox functions. The other things to note is that there are multiple mousebox functions and there is an issue with losing focus. Read on.
The mousebox function that is used fro this example is the SetKey() function. As documented by Craig Hales, Dec 2015, using some of the built-in keyboard shortcuts can cause the mousebox to loose focus. So this script adds a button to refocus so it can be reset. To test, use select one of the hand tools like the select (fat plus sign) then select some arrow keys and the keys ar no longer displayed. Click on the Refocus button, then click on the arrow keys and the text for teh buttons now appear.
To test the functionality, select several points from the Graph Builder plot. selct some arrow keys, then select Home. A window of your selected yourw will appears. Make another set of selections, and click on Home again.
This Refocus button also provides an example if you wish to use a button box and not a keyboard key to initiate a task. For demonstartion, I kept a textbox that prints the keyboard key. I learned a lot from Craig Hales example in 2015, so the script contains the link and, the this script's set key function emulates his example.
This script was tested in JMP 12, 13 and 14.