By default, the Adis function keys are enabled, although you can disable them or make them act as function keys instead.
However, before you can use the user function keys, they must be enabled. If a user key is enabled, it terminates the ACCEPT operation when it is pressed. If the key is disabled, the key is rejected and the bell rung.
Use the following call to selectively enable and disable the user function keys:
call x"AF" using set-bit-pairs user-key-control
where set-bit-pairs and user-key-control are defined in the Working-Storage Section of your program as follows:
01 set-bit-pairs pic 9(2) comp-x value 1. 01 user-key-control. 03 user-key-setting pic 9(2) comp-x. 03 filler pic x value "1". 03 first-user-key pic 9(2) comp-x. 03 number-of-keys pic 9(2) comp-x.
Function keys are enabled or disabled until explicitly changed by another call to x"AF", or until the application terminates. Calls to enable or disable function keys are cumulative. For example, if you call x"AF" to enable function key F1, then make a second call to enable F10, both keys are enabled.
The following code enables the Escape key and function keys F1 and F10, but disables all other user function keys:
* Enable Escape key move 1 to user-key-setting move 0 to first-user-key move 1 to number-of-keys call x"AF" using set-bit-pairs user-key-control * Disable 126 keys starting from key 1 move 0 to user-key-setting move 1 to first-user-key move 126 to number-of-keys call x"AF" using set-bit-pairs user-key-control. * Enable F1 and F10. move 1 to user-key-setting * Enable F1. move 1 to first-user-key move 1 to number-of-keys call x"AF" using set-bit-pairs user-key-control * Enable F10 move 10 to first-user-key call x"AF" using set-bit-pairs user-key-control