Example, 18 the onvtcommand event, Syntax – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual
Page 98
N
AURTECH
W
EB
B
ROWSER AND
T
ERMINAL
E
MULATION FOR
W
INDOWS
CE
AND
W
INDOWS
M
OBILE
CETerm Scripting Guide
Page 98
Example
This example activates a corresponding trigger handling function in the current
browser session.
/* OnTriggerEvent */
function OnTriggerEvent( flags, id )
{
var index = CETerm.ActiveSession;
var Session = CETerm.Session(index);
if (Session.Browser.Document != null)
{
// Current session is browser session.
// Hand off processing to web page.
var script = "OnTriggerEvent("+ flags + "," + id + ");";
Session.Browser.RunScript( script );
}
}
4.18
T
HE
O
N
VTC
OMMAND
E
VENT
The OnVTCommand event is fired when a special command format is received by
a VT emulation session. The command includes a variable number of arguments
that depends on the received command. The handler script may perform any
desired actions. The screen text may contain additional information used by the
handler.
Syntax
function OnVTCommand ( session, command, arg1, arg2, arg3, arg4 )
session
– index of session receiving the command
command
– activating command, “ESCBangS”, “ESCTilda”, “APC”,
“OSC”, “PM”, “PU1”, “PU2”
arg1
– command argument. Terminating character for ESCTilda. Up to 16
arguments with values which range between 0 and 99 for ESCBangS.
Unspecified ESCBangS arguments have the value -99. String with content for
other commands.
Example
This example shows how to process the various possible arguments.