Promotic
WikipediaLinkedInYoutubeTwitterFacebook

onKeyPress - event of object PmaPanel

Description:
The event is triggered for the active panel after 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 and if the "Enable multiple opening of local panel" configurator IS NOT SET.

Parameters:
pMe(Object) Reference to the PmaPanel object where the event rises.
pEvent(Object) Reference 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 the Pm.StringCodeFrom method can be used.

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.
Note:
The event has the same parameters as the PmaRoot.onKeyPress event or the PmgObject.onKeyPress event.
Example:
Example of the event content. Here 'hot' keys are defined for switching of this panel and another action.
JavaScriptVBScriptSelect and copy to clipboard

if (pEvent.Action == 1 && pEvent.Ctrl)
{
switch (pEvent.Code)
{
case 67:  //Key C
//close this panel
pMe.Close();
break;
case 66:  //Key B
//some another action
break;
}
}
PROMOTIC 9.0.8 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