java.awt.event

Interface KeyListener

public interface KeyListener extends EventListener

This interface is for classes that wish to receive keyboard events. To watch a subset of these events, use a KeyAdapter.

Since: 1.1

See Also: KeyAdapter KeyEvent

UNKNOWN: updated to 1.4

Method Summary
voidkeyPressed(KeyEvent event)
This method is called when a key is pressed.
voidkeyReleased(KeyEvent event)
This method is called when a key is released.
voidkeyTyped(KeyEvent event)
This method is called when a key is typed.

Method Detail

keyPressed

public void keyPressed(KeyEvent event)
This method is called when a key is pressed.

Parameters: event the KeyEvent indicating the key press

keyReleased

public void keyReleased(KeyEvent event)
This method is called when a key is released.

Parameters: event the KeyEvent indicating the key release

keyTyped

public void keyTyped(KeyEvent event)
This method is called when a key is typed. A key is considered typed when it and all modifiers have been pressed and released, mapping to a single virtual key.

Parameters: event the KeyEvent indicating that a key was typed