Rockwell Automation 2711P Software Development Kit User Manual User Manual
Page 22
Publication 2711P-UM005A-EN-P - March 2007
22 Introduction to the PanelView Plus CE Terminal
• 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 keydown 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.
When the keypad driver is loaded by device.exe at system start-up, it
reads the keypad ID from the Display Module. If it does not find a
valid keypad ID, it concludes that there is no keypad and 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 the keypad.
When a key on the keypad is pressed or released, the keypad scanner
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 mapping 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 main keyboard driver,
Keybddrv.dll.