Key Mapping
All keystrokes entered through _ninput.utl are processed through a central keymap routine. This provides an easy way to customize keystrokes based on the functions available on different keyboards and user preferences. The key mapping treats certain keys as input terminators and returns a control value in the CTLVAL variable. The CALLing utility decides how to handle different CTLVAL values.
Although there is a standard or default keymap, nothing dictates what ACTIONS an application must perform based on the values returned to the application. The default action for CTLVAL=2 is <EXECUTE>. However, the developer may define it as <DELETE> within the application. The only action the application sees is that the value of 2 has been assigned to the CTLVAL. The developer can then determine, within the application, what to do with this value.
Through the use of the _ekeymap.utl utility, the developer and/or user has complete flexibility in determining which function or edit key will return a value of 2. There is a unique relationship between the keystroke received and the CTLVAL assigned by the input control utility. The label is extraneous to the process, with the exception of the input editing keys. However, the label may be retrieved within the application by referencing a global string. For example, STBL("#F4") returns the label associated with CTLVAL 4.
Application-Defined Function Keys
The key mapping portion of the Input Subsystem lets developers define up to eight application-specific function keys. Each key can be configured to perform one of two functions:
-
CALL the specified utility inside the input control utility, and continue input.
-
Terminate input, and set the specified CTLVAL.
Keystroke Processing
To specify what action the input control utility accepts and how it process that action, the input process has been defined as having several states. These states include the input or edit control state, the internal function processing state (including application-defined processes), and standard processing. Depending on which state the input process is in, the keystrokes received may be processed differently.
For a complete list of the defaults, refer toKey Maps.