Progress
Programming
Handbook
Accelerators in Character Interfaces
For character interfaces, the choice of key labels is limited by those keys available on your keyboard. Thus, key labels are not necessarily portable between terminal types. For example, some terminals have no F2 key, but might have a PF2 key or require a CTRL key combination to emulate common F2 key functionality.
Specifying Portable Accelerators
For portability, you can use the KBLABEL function to specify the accelerator key label.
This allows you to use a portable Progress key function (such as HELP) to identify a valid key label for the current keyboard (terminal type). The key label is one that is associated with the key function for the terminal type in the current environment. On Windows, the current environment might reside in the registry or in an initialization file. On UNIX, the current environment resides in the PROTERMCAP file.
However, note that the current environment can (and often does) define more than one key label for a given Progress key function. The KBLABEL function returns the first such definition specified for the terminal type. For example, some terminal types define F2 and also ESC–? as the HELP key function. In this case, using KBLABEL(“HELP”) changes F2 to a menu item accelerator (losing its HELP key function), but leaves ESC–? as the one remaining HELP key function.
Handling Invalid Accelerators
There are two types of invalid menu accelerators:
If you specify an unsupported key label, say ALT in ALT–F9, Progress substitutes a supported key label in its place. Thus, Progress might substitute ESC–F9 for ALT–F9 as the accelerator definition.
However, an accelerator like ESC–F9 might not work at run time. In this case, ESC–F9 generates unrecognizable keyboard code sequences that fail to fire the appropriate Progress event. The terminal might also indicate the failure with a beep or other warning signal.
When in doubt, specify the menu accelerator using the terminal-portable KBLABEL function described earlier.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |