Secure Global Desktop 4.31 Administration Guide > Applets > sendKey (terminal emulator applet)
void sendKey(strKey, strModifier)
The sendKey
method sends the specified action key
(strKey) to the application being displayed by the terminal
emulator applet. Action keys are keys that you can't send to
applications using the setText
method
(Return
or Delete
, for example).
You can also specify one or more modifier keys to use
(Shift
or Ctrl
, for example).
The action keys (strKey) you can send are:
CapsLock
Delete
Down
End
Enter
Escape
F1
to F12
Home
Insert
Left
NumLock
PageDown
PageUp
Pause
PrintScreen
Return
Right
ScrollLock
Tab
Up
The modifier keys (strModifier) you can send are:
To send this modifier key... | Use this value... |
---|---|
No modifier key | 0 |
Shift | 1 |
Ctrl | 2 |
Alt | 4 |
To specify more than one modifier key, add values together. For
example, use 5
to specify Shift+Alt
or
7
to specify Shift+Ctrl+Alt
.
<SCRIPT LANGUAGE="JavaScript"> function pageUp() { document.applets["Tarantella Terminal Emulator"].sendKey("PageUp", 0); } function pageDown() { document.applets["Tarantella Terminal Emulator"].sendKey("PageDown", 0); } </SCRIPT> <FORM> <INPUT TYPE=button VALUE="Scroll Page Up" onclick="pageUp()"> <INPUT TYPE=button VALUE="Scroll Page Down" onclick="pageDown()"> </FORM>
This example adds two buttons beneath the terminal emulator applet.
When a user clicks one of the buttons, Secure Global Desktop sends
PageUp
or PageDown
, as appropriate.
Add the code to the HTML document containing the terminal emulator
applet (tde.html
, in the sco/tta/standard
webtop theme), after the TTAAPPLET
declaration.
Note This example assumes you are using the sco/tta/standard webtop
theme. If you're using another theme, with different frame names and
layouts, or different applet names, you'll need to modify the lines
that invoke the sendKey
method to access the terminal
emulator applet used by your new theme.
Copyright © 1997-2007 Sun Microsystems, Inc. All rights reserved.