Enabling Input Devices (C Programs)

Input devices are specified as the components of a bit mask, as described in Input Devices of a Device Group. The following function activates input devices:

void dvc_set_inp_mask(unsigned device_mask)

This function enables and disables input devices. Each input device corresponds to one bit in the device mask. Input device 0 corresponds to the keyboard.

For example if KEYBOARD=1,SCANNER=2 and MSR=4 then an input device mask of 3 enables KEYBOARD and SCANNER but disables MSR.

It is good practice to follow the example of PROGRUN and explicitly enable input before each field, and to set the input mask to 0 again once input in a field is completed. This makes it much easier for the OSDI to be sure that data from devices such as bar code readers is being read correctly.