|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Defines the general contract for terminal input.
| Field Summary | |
static int |
KEY_ACTION
|
static int |
KEY_ALT
|
static int |
KEY_CONTROL
|
static int |
KEY_SHIFT
|
| Method Summary | |
java.io.OutputStream |
getKeyboardOutputStream()
Get an OutputStream which can be used to write data into a terminal much like a keyboard. |
void |
keyPressed(int keyCode,
char keyChar,
int modifiers)
A key has been pressed. |
void |
keyTyped(int keyCode,
char keyChar,
int modifiers)
A key has been typed. |
void |
mousePressed(int x,
int y,
int modifiers)
A mouse button has been pressed. |
void |
mouseReleased(int x,
int y,
int modifiers)
A mouse button has been released. |
void |
setKeyCodes(java.util.Properties codes)
The definition of key codes should only be done if your application uses a very different keyboard layout than the standard vt320. |
| Field Detail |
public static final int KEY_CONTROL
public static final int KEY_SHIFT
public static final int KEY_ALT
public static final int KEY_ACTION
| Method Detail |
public java.io.OutputStream getKeyboardOutputStream()
public void mousePressed(int x,
int y,
int modifiers)
x - y - modifiers -
public void mouseReleased(int x,
int y,
int modifiers)
x - y - modifiers - public void setKeyCodes(java.util.Properties codes)
F1 = testCPGUP = pgup pressedAF12 = \\e
As you can see the string you can define may contain special characters
which may be escaped using the backslash (\). Allowed special characters
follow in the table below:
(Important: for some of the escape codes you need two backslashes as these
are our own definitions and not known by the Java Property mechanism)
Character Explanation
\\b Backspace, this character is usually sent by the <- key
(not the cursor left key!).
\\e Escape, this character is usually sent by the Esc key.
\n (only one backslash) Newline, this character will move the cursor
to a new line. On UNIX systems it is equivalent to carriage return + newline.
Usually the Enter key send this character.
\r (only one backslash) Carriage Return, this key moves the cursor
to the beginning of the line. In conjunction with Newline it moves the cursor
to the beginning of a new line.
\t (only one backslash) Tabulator, the tab character is sent by the
{key:->} key and moves the cursor to the next tab stop defined by the terminal.
\\v Vertical Tabulator, sends a vertical tabulator character.
\\a Bell, sends a terminal bell character which should make the
terminal sound its bell.
\number Inserts the character that is defined by this number in the ISO
Latin1 character set. The number should be a decimal value.
The following table explains which key may be redefined. As explained above
each of the keys may be prefixed by a character defining the redefinition
that occures if it is pressed in conjunction with the shift, control or alt keys.
Key Comments
F1 - F20 The function key, F1, F2 ... up to F20.
PGUP The Page Up key.
PGDOWN The Page Down key.
END The End key.
HOME The Home (Pos 1) key.
INSERT The Insert key.
REMOVE The Remove key.
UP The Cursor Up key.
DOWN The Cursor Down key.
LEFT The Cursor Left key.
RIGHT The Cursor right key.
NUMPAD0 The numbered Numpad keys.
...
NUMPAD9 The numbered Numpad keys.
ESCAPE The ESCAPE key.
BACKSPACE The backspace key.
TAB The tabulator key.
- Parameters:
codes - properites object containing the key codes.
public void keyPressed(int keyCode,
char keyChar,
int modifiers)
keyCode - keyChar - modifiers -
public void keyTyped(int keyCode,
char keyChar,
int modifiers)
keyCode - keyChar - modifiers -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||