Hotkey Workshop

The Hotkey Workshop can assist you in composing a definehotkeys statement. The idea is simple — you press any key, and the workshop gives you the code needed to turn that key into a hot key.

To open the workshop, choose Hotkey Workshop from the Program menu. (Note: This menu is only available when you are editing a named procedure.) Here is the initial appearance of the workshop.

When you first open it, the workshop is waiting for you to press the key (or key combination) you want to use as a hotkey. Each time you press a key, the workshop will show you the key you pressed. Here’s what the workshop looks like if you press the K key with the OPTION key also pressed.

Once you’ve pressed the key you want, you need to disable the keyboard monitoring. Otherwise, you won’t be able to use the keyboard normally. To disable monitoring, click on the keyboard icon in the upper left corner of the workshop. When monitoring is disabled, the icon turns from green to gray. (You can click again if you want to start monitoring again, for example if you want to change to a different keystroke.)

Use the pop-up menu to specify the scope of the hotkey. (See the definehotkeys statement to learn more about hotkey scope.)

The next step is to type in the code that will be triggered when the hotkey is pressed.

You can try out the code by pressing the blue button.

The workshop will show you errors in your code as you type. You can ignore these errors until you have finished the code.

Once everything is complete, you’ll need to copy the finished code to the procedure where it will be used. There are several ways you can do this.

Press the Copy button, then paste into your actual code.

You can click on the text itself, drag over it to select the text, and press Command-C to copy it, then paste into your code.

Or you can click on the curved arrow in the left corner and drag the text to the window you want.

When you’re done, you can simply close the Hotkey Workshop window. (However, the workshop will forget all of the options you have set up when you close the window.)

#### Putting HotKey Code in a Custom Library

A good place to define global hotkeys is in the .InitializeHotKeys procedure inside a custom statement library (inside the ~/Library/Application Support/PanoramaX/Libraries folder). If you put your custom hotkey definition code in that procedure, it will run automatically when Panorama starts up, and will also run automatically when you use the Libraries>Register Functions and Libraries command in the View Organizer.

#### Multiple Workshop Windows

You are not limited to a single Hotkey Workshop window at a time. To open additional windows, press the green arrow icon in the upper left corner. You can also open a new window by choosing Window>New Keystroke Window.

See Also

- --
- definehotkeys -- defines one or more Hotkeys.
- info("keyboard") -- returns the last key that was pressed.
- info("keycode") -- returns a special numeric code that represents the last key that was pressed.

History

Version | Status | Notes
10.1.1 | New | New in this version.