Rockwell Automation 6182 SDK User Manual
Page 22

1–16
Introduction to the RAC6182
Publication 6182-UM002B-EN-P
Support for assignment of special functions to key operations by
application programs.
Support for a ‘single-key’ mode, in which keystrokes are processed
one at a time. Following an initial key-down event, any other key-
down or key-events will be ignored until the key-up event
corresponding to the initial key-down event has been detected and
processed.
Support for a ‘hold-off’ mode, in which successive strokes of a given
key occurring within a given time period will be ignored.
After the keypad driver is loaded by device.exe at system start-up, it
attempts to read the keypad ID from the bezel EEPROM. If it does not
find a valid ID, it exits. Otherwise, using the keypad ID, the driver
locates an entry in the CE system registry that points to the current scan
code to virtual code translation table for the keypad.
The keypad driver then attempts to load the keypad handler and verify
that it supports a set of callback functions that the driver requires it to
have. If the keypad handler dynamic link library is not present or does
not contain all the necessary callback functions, a default keypad handler
stub is loaded. This handler stub implements all the necessary callbacks
and information for mapping one particular model of keypad, but it
cannot handle changing key mappings, macros, actions, or other models
of keypad.
When a key on the keypad is pressed or released, the keypad processor
sends two codes to the keypad driver. One code is a scan code
corresponding to the key pressed or released; the other is an event code
identifying the type of event (key up or key down). Using the current
translation table, the driver converts the scan code into a Windows
Virtual key code. The driver maintains the modifier, auto-repeat, and
multiple-keys states.
The driver does additional processing of key events to determine if these
events meet the conditions of repeat mode, hold-off mode or single-key
mode, provided these modes are enabled.
Once it has finished its low level processing, the driver calls the keypad
handler function KhTranslateVkey(), passing the virtual key code to this
function. The keypad handler returns an array of translated virtual
code(s).
Finally, the driver calls a Win32 API function kbd_event() to pass the
key events to the GWES keyboard driver.
Keypad Handler
The Rockwell supplied keypad handler is an optional software
component that can be replaced with a stub or with another keypad
handler designed for a specific application. The handler operates on
Windows Virtual Key codes supplied by the keypad driver. It can