# Options and Utilities

User-Defined CTLS |

User-defined CTLS are used to associate a program or an event with a specific function key value or negative CTL definition. When the user presses the corresponding key, NOMADS executes the logic or program you associated with the event.

User CTLS can be local to a panel or global across all libraries. See Assigning Global CTLS. To define user CTL values that are local to the current panel, the User Defined CTL Values utility is used.

Invoke the User Defined CTL Values utility from the NOMADS Panel Designer by selecting Utilities > User CTLS from the menu bar or the Ctls option on the tool bar.

The following window is displayed:

(The use of a grid for entering CTL values was added in PxPlus 2021.)

This window consists of the following:

CTL Value | Numeric CTL value to be assigned. Click the drop-down arrow for a list of commonly used CTL values (10=F10, -1010=Home, etc.) and any other values defined for the current panel. A new value not on the list can also be entered.
Description | Displays the CTL value description, if available.
Process | Click the drop-down arrow for a list of available processes:
Link | Invoke another panel passing optional arguments.
Perform | Perform a program.
Call | Call a program.
Execute | Execute a series of statements separated by semi-colons.
End | Terminate panel.
Logic | Logic to be executed.
(Delete) | Button used to delete one or more selected CTL values from the grid. To select multiple CTL values, use Shift-Click (consecutive selections) or Ctrl-Click (random selections). Prior to deleting, a message will display. (The Delete button was added in PxPlus 2021.)
OK | Saves any changes and closes the User Defined CTL Values utility.
Cancel | Closes the User Defined CTL Values utility without saving any changes.

## Assigning Global CTLS

To define global CTLS (applicable to all libraries), load the reserved variable %NOMADS_FKEY_HANDLER$ with a user-defined program name. Your program will be processed by *winproc at run time.

Example:

> 0010 !Program: FKEYS
> 0020 IF CTL=3 MSGBOX "The F3 key was pressed"
> 0030 EXIT

#### Note:
Local CTLS are executed before global ones.

## Negative CTLS

PxPlus normally handles all negative CTL values internally:

| Values -1 to -999 | Used by the input handler to save current instructions, internally call *control
| Values -1000 to -1999 | Used for input editing control keys and mouse interaction
| Values -2000 to -2255 | Used for composite character generation
| Value -2255 and values below that | Reserved for future expansion

See Negative CTL Definitions for a list of negative control values.

Example 1:

| CTL Value: | -1014=Page Down
| Process: | Execute MSGBOX "Test","F.Y.I"
| Result: | When the user presses the Page Down key, the message box is triggered.

Example 2:

| CTL Value: | 6=F6
| Process: | Perform "cstmtc;init_stuff"
| Result: | When the user presses the F6 key, NOMADS performs the cstmtc program logic, starting at the init_stuff entry label.