Programming Guide


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 key with one of these values:

The new action to assign to key.



Use sm_keyoption to change at runtime how sm_input processes key, where key is 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 mode: KEY_ROUTING, KEY_GROUP and KEY_XLATE. The newval arguments that are valid for each mode are described below. All of these modes accept a logical key constant for key.

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 newval:

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 newval:

Allows access to the cursor table. Use this mode to assign key the action performed by newval. key can be any cursor control key excluding INS, MNBR, REFR, SFTS, and LP. newval can 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);