Casio Naurtech CETerm Ver.5.5 Scripting Guide Manual do Utilizador Página 21

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 164
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 20
NAURTECH WEB BROWSER AND TERMINAL EMULATION FOR WINDOWS CE AND WINDOWS MOBILE
CETerm Scripting Guide Page 21
2.7 CUSTOM SCREEN HOT-SPOTS
A “hot-spot” is an area on a terminal emulation screen that is activated by taping
with your finger or the stylus. CETerm supports several pre-defined hot-spots for
TE sessions. With scripting, it is possible to define custom hot-spot behaviors.
Custom hot-spots use the “OnStylusDown” event handler. Browser sessions do
not support the OnStylusDown event because equivalent behavior can be
implemented in HTML. You may need to disable the pre-defined hot-spots in
CETerm because they will be triggered before a custom hot-spot.
The hot-spot action can depend on the screen contents in an area or simply be
tied to a screen area. The following OnStylusDown handler can be loaded from
the script templates
/* OnStylusDown */
function OnStylusDown( session, row, column )
{
// Look for custom hot-spot
var screen = CETerm.Session( session ).Screen;
var text = screen.GetTextLine( row );
if (text.match( /beep/i ))
{
OS.PlaySound( "default.wav", 0 );
}
}
This hot-spot will play a sound if the line touched contains the word “beep”. The
following hot-spots will activate VT function keys if the user touches in the
specified rows and columns. In this case, the screen can show a box drawn with
VT line drawing characters and text inside each box. With such a display, you
can effectively create large glove-friendly on-screen buttons in TE.
/* OnStylusDown */
function OnStylusDown( session, row, column )
{
// Buttons are on rows "start" through "end"
var buttonrowstart = 9;
var buttonrowend = 13;
var IDA = "IDA_NONE";
// Buttons are "buttonwidth" columns wide
// Leftmost button is #1
var buttonwidth = 5;
var button = Math.floor((column + buttonwidth - 1) /
buttonwidth);
if (row >= buttonrowstart && row <= buttonrowend)
{
switch (button) {
Vista de página 20
1 2 ... 16 17 18 19 20 21 22 23 24 25 26 ... 163 164

Comentários a estes Manuais

Sem comentários