pMe | (Object) Reference to the PmaRoot object where the event rises. |
---|---|
pEvent | (Object) Reference to an object describing detailed information about the specific event.
pEvent.Action - (Long) [for reading] Indication of pressing or releasing the key.
0 - releasing the key
1 - pressing the key pEvent.Code - (Long) [for reading] Pressed key code. In 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. |
var oCreator;
var sTarget;
function onViewClose(ev)
{
if (ev.CloseReason == "ok")
{
var sViewer = ev.ReturnValue;
if (Pm.IsValid(sViewer))
{
Pm.CreateView(Pm.GetActiveWorkspace(), sViewer, "", sTarget).Open();
}
}
}
if (pEvent.Action == 0 && pEvent.Ctrl && ! pEvent.Shift && ! pEvent.Alt)
{
switch (pEvent.Code)
{
case 83:
// Key S
Pm.AppStop();
break;
case 73:
// Key I
Pm.CreateView(Pm.GetActiveWorkspace(), "/#glob/infosystem", "", "target:_blank;").Open();
break;
case 80:
// Key P
Pm.WndLogon(true);
break;
case 79:
// Key O
Pm.WndLogoff(true);
break;
case 71:
// Key G
sTarget = "target:main;";
oCreator = Pm.CreateView(Pm.GetActiveWorkspace(), "/#glob/list", "autoselect:1", "target:_blank;modal:1;size:300,350;");
oCreator.View.list = Pm.FindViewers("groups:menu;viewers:panel;", "", "headers:;columns:path,title;");
oCreator.View.title = Pm.EvalMacro("$.text('sys','panelsName')");
oCreator.View.onClose = onViewClose;
oCreator.Open();
break;
case 65:
// Key A
sTarget = "target:_blank.alarms;size:1000,500;";
oCreator = Pm.CreateView(Pm.GetActiveWorkspace(), "/#glob/list", "autoselect:1", "target:_blank;modal:1;");
oCreator.View.list = Pm.FindViewers("groups:menu;viewers:alarm_state;", "", "columns:path,title,alstate3,alstate2,alstate1,alhoot;");
oCreator.View.title = Pm.EvalMacro("$.text('sys','alarmsName')");
oCreator.View.onClose = onViewClose;
oCreator.Open();
break;
case 69:
// Key E
sTarget = "target:_blank.events;size:1000,500;";
oCreator = Pm.CreateView(Pm.GetActiveWorkspace(), "/#glob/list", "autoselect:1", "target:_blank;modal:1;");
oCreator.View.list = Pm.FindViewers("groups:menu;viewers:event;", "", "columns:path,title;");
oCreator.View.title = Pm.EvalMacro("$.text('sys','eventsName')");
oCreator.View.onClose = onViewClose;
oCreator.Open();
break;
}
}