Promotic

onKeyPress - event of the PmgObject object

Description:
The event is triggered after pressing or releasing the key of the keyboard, if the object has the focus (only the object with the focus gets the message).
The event can be used, for example, for controlling the item by the keyboard.
Parameters:
pMe(Object) Reference to the PmgObject object where the event rises.
pEvent(Object) Reference to the object describing detailed information about the specific event.
pEvent.Action - (Long) [for reading] Indication of pressing or releasing the key.
0 - key release
1 - key press
pEvent.Code - (Long) [for reading] Pressed key code. In the case of an ANSI character the value equals the char code, for the other codes see Keys constants.
For conversion of such numeric code into String the Pm.StringCodeFrom method can be used.
pEvent.Ctrl - (Boolean) [for reading] Indication of concurrent pressing the Ctrl key.
pEvent.Shift - (Boolean) [for reading] Indication of concurrent pressing the Shift key.
pEvent.Alt - (Boolean) [for reading] Indication of concurrent pressing the Alt key.
Note:
The event has the same parameters as the PmaRoot.onKeyPress event.

- This event is triggered only if the "Control enabled" configurator is checked.
- This event is also functional in Web panels.
- This event is not functional for object: PmgRoot, PmgActiveX.
See also:
Example:
The example of the event content. Here 'hot' keys are defined for two various actions.
JavaScriptVBScriptSelect and copy to clipboard

if (pEvent.Action == 1 && pEvent.Ctrl)
{
switch (pEvent.Code)
{
case 65:
// Key A
// Calling some 1st action
break;
case 66:
// Key B
// Calling some 2nd action
break;
}
}
PROMOTIC 9.0.27 SCADA system documentation MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r.o.