onKeyPress - event of object PmPanel

The event fires for the active panel on pressing or releasing a key.

This method/property/event is considered obsolete and is functional only if the Level of integration of panel viewer and the local application configurator is set to full - FULL access from scripts to the whole application (only for VBScript value and if the Enable multiple opening of local panel configurator IS NOT SET.

pMe(Object) Reference to the Promotic object 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 or PmiItem.onKeyPress event.
An example of the event content. Here 'hot' keys are defined for switching of this panel and another action.
If pEvent.Action = 1 And pEvent.Ctrl Then
  Select Case pEvent.Code
    Case 67 ' Key C
      pMe.Close 'close this panel
    Case 66 ' Key B
      'some another action
  End Select
End If
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice