Sets cursor control key options#include <smkeys.h>int sm_keyoption(int key, int mode, int newval);
- The key whose processing you wish to change.
- Specifies the type of action to take on
keywith one of these values:
KEY_ROUTINGlets you disable a key or explicitly control the action taken when a key is pressed.
- The new action to assign to
sm_keyoptionto change at runtime how sm_input processes
keyis a cursor control key. Default key option values are built into Panther. This function only works with cursor control keys; these include all Panther logical keys except those of type PF, SPF, and APP. Refer to Table 6-1 in Configuration Guide for a list of Panther logical keys.
There are three different possible values for
newvalarguments that are valid for each mode are described below. All of these modes accept a logical key constant for
- Allows access to the EXECUTE and RETURN bits of the routing table. Use this mode to disable a key or to explicitly control the action to take when a key is pressed. The following constants can be assigned to
KEY_IGNORE. Disables key. Panther does nothing when key is struck.
- Allows access to the group action bits. Use this mode to control the action of the cursor when it is within a group. The following values can be assigned to
VF_GROUP— Obey group semantics. Hitting key causes the cursor to move to the next field within the group in the indicated direction. If this constant is OR'd with
VF_CHANGEthe cursor exits the group in the indicated direction.
- Allows access to the cursor table. Use this mode to assign
keythe action performed by
keycan be any cursor control key excluding
newvalcan be any key—logical, function, application, ASCII, and so on.
/* newline_is_xmit: Map the new line key (Return or Enter on
* most keyboards) to XMIT -or- reset it back to NL.
* Invoke from a control string as:
* ^newline_is_xmit X To make NL act as XMIT
* ^newline_is_xmit N To make NL act as NL */
int newline_is_xmit(char *cs_data);
while (*cs_data && *cs_data != ' ')
while (*cs_data == ' ')
if (*cs_data == 'X')
sm_keyoption(NL, KEY_XLATE, XMIT);
sm_keyoption(NL, KEY_XLATE, NL);