onKeyPress - event of object PmiItem

The event fires on pressing or releasing the key of the keyboard, if the item has a focus (only the item with the focus gets the message). The event can be used for controlling the item by the keyboard.
pMe(Object) Reference to the graphic item where the event rises.
pEvent(Object) A referrence to object describing detailed information about the specific event.
pEvent.Action - (Integer) Indication of pressing or releasing the key.
0 - key release
1 - key press
pEvent.Code - (Long) Pressed key code. In case of an ANSI character the value equals the char code, for the other codes see Keys constants.

In order to convert such numeric code into String use the Pm.StringCodeFrom method.

pEvent.Ctrl - (Boolean) Indication of concurrent pressing the Ctrl key.
pEvent.Shift - (Boolean) Indication of concurrent pressing the Shift key.
pEvent.Alt - (Boolean) Indication of concurrent pressing the Alt key.
The event has the same parameters as the PmRoot.onKeyPress event.
- This event will be called only if the Control enabled configurator is checked.
- This event is also functional for Web panels.
- This event is not functional for graphic item: PmiRoot, PmiAx.
See also:
The example of the event content. Here 'hot' keys are defined for two various actions.
If pEvent.Action = 1 And pEvent.Ctrl Then
  Select Case pEvent.Code
    Case 65 ' Key A
      ' calling some 1st action
    Case 66 ' Key B
      ' calling some 2nd action
  End Select
End If
PROMOTIC 8.3.20 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice