Syntax, Example, 17 the ontriggerevent event – Casio Naurtech CETerm Ver.5.5 Scripting Guide User Manual
Page 97

N
AURTECH
W
EB
B
ROWSER AND
T
ERMINAL
E
MULATION FOR
W
INDOWS
CE
AND
W
INDOWS
M
OBILE
CETerm Scripting Guide
Page 97
Syntax
function OnStylusDown ( session, row, column )
session
– index of currently active session
row
– row of screen tap
column
– column of screen tap.
Example
Several samples for OnStylusDown were given in Section 2.7. Following is an
example that starts a barcode scan if the row contains the word “scan”. Not all
hardware devices support a scan trigger by script. If tapping on an IBM screen,
you must tap on an input field in the row, or the focus will not be in an input field
when the scan is sent to the session. Of course the “OnBarcodeRead” handler
could be used to force the scanned data into a preferred input field.
/* OnStylusDown */
function OnStylusDown ( session, row, column )
{
var screen = CETerm.Session( session ).Screen;
// Get row of text
var text = screen.GetTextLine( row );
// Look for "scan" as case-insensitive match
if (text.match( /scan/i ))
{
CETerm.PostIDA( "IDA_SCAN_TRIGGER", 0 );
}
}
4.17
T
HE
O
N
T
RIGGER
E
VENT
E
VENT
The OnTriggerEvent event is fired when the hardware trigger state changes.
Syntax
function OnTriggerEvent ( flags, id )
flags
– flags describing state change
id
– trigger id