charva.awt.event

Class KeyAdapter

Implemented Interfaces:
EventListener, KeyListener

public abstract class KeyAdapter
extends java.lang.Object
implements KeyListener

An abstract class for receiving key events. The methods provided in this class are empty; the class is provided as a convenience for implementing the KeyListener interface. You only have to implement the methods you are interested in.

Method Summary

void
keyPressed(KeyEvent ke)
KEY_PRESSED events are fired when any key (including a function key and cursor key) is pressed while the component has keyboard input focus.
void
keyReleased(KeyEvent ke)
This method is never called in CHARVA, but is present for compatibility with javax.swing.
void
keyTyped(KeyEvent ke)
KEY_TYPED events are fired when a key representing a valid text character (not a function key or cursor key) is pressed.

Method Details

keyPressed

public void keyPressed(KeyEvent ke)
KEY_PRESSED events are fired when any key (including a function key and cursor key) is pressed while the component has keyboard input focus. KeyEvent.getKeyCode() can be used to find out which key was pressed.
Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent ke)
This method is never called in CHARVA, but is present for compatibility with javax.swing.
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent ke)
KEY_TYPED events are fired when a key representing a valid text character (not a function key or cursor key) is pressed. KeyEvent.getKeyChar() can be used to get the ASCII code of the key that was pressed.
Specified by:
keyTyped in interface KeyListener