|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TGKeyHandler
TGKeyHandler is an interface that a class implements when it would like to receive Java AWT key events from TGCanvas. The provided methods are an attempt to reduce the complexity of the, more general, KeyListener interface methods.
In the case of TG, TGDriver registers with TGCanvas, passing the events on to the current jLogo program, invoking specific user-defined procedures if they exist.
In the case of TurtleGraphicsWindow, the methods in this interface are stubs that should be overridden by child classes if they want to handle keyboard key events.
Field Summary | |
---|---|
static int |
ALT
[Alt] action key's numeric value for jLogo program. |
static int |
CONTROL
[Ctrl] action key's numeric value for jLogo program. |
static int |
DOWN
Deprecated. |
static int |
DOWN_ARROW
[ v ] down-arrow action key's numeric value for jLogo program. |
static int |
LEFT
Deprecated. |
static int |
LEFT_ARROW
[ <- ] left-arrow action key's numeric value for jLogo program. |
static int |
RIGHT
Deprecated. |
static int |
RIGHT_ARROW
[ -> ] right-arrow action key's numeric value for jLogo program. |
static int |
SHIFT
[Shift] action key's numeric value for jLogo program. |
static int |
UP
Deprecated. |
static int |
UP_ARROW
[ ^ ] up-arrow action key's numeric value for jLogo program. |
Method Summary | |
---|---|
void |
tgKeyPressed(int keyNum)
TGCanvas (a Component) passes on KeyListener.keyPressed() KeyEvents (simplified a bit) to classes that register with it and implement TGKeyHandler. |
void |
tgKeyReleased(int keyNum)
TGCanvas (a Component) passes on KeyListener.keyReleased() KeyEvents (simplified a bit) to classes that register with it and implement TGKeyHandler. |
void |
tgKeyTyped(char keyChar)
TGCanvas (a Component) passes on KeyListener.keyTyped() KeyEvents (simplified a bit) to classes that register with it and implement TGKeyHandler. |
Field Detail |
---|
static final int DOWN
static final int LEFT
static final int RIGHT
static final int UP
static final int UP_ARROW
static final int DOWN_ARROW
static final int LEFT_ARROW
static final int RIGHT_ARROW
static final int ALT
static final int CONTROL
static final int SHIFT
Method Detail |
---|
void tgKeyPressed(int keyNum)
keyNum
- a character or action key identifierALT
,
CONTROL
,
DOWN_ARROW
,
LEFT_ARROW
,
RIGHT_ARROW
,
SHIFT
,
UP_ARROW
void tgKeyReleased(int keyNum)
keyNum
- a character or action key identifierALT
,
CONTROL
,
DOWN_ARROW
,
LEFT_ARROW
,
RIGHT_ARROW
,
SHIFT
,
UP_ARROW
void tgKeyTyped(char keyChar)
keyChar
- a Unicode character
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |