java::awt::event::KeyListener Class Reference

Inheritance diagram for java::awt::event::KeyListener:

Inheritance graph
java::awt::event::KeyAdapterjava::util::EventListenerjava::lang::Interfacejava::lang::Object
[legend]
Collaboration diagram for java::awt::event::KeyListener:

Collaboration graph
java::util::EventListenerjava::lang::Interfacejava::lang::Object
[legend]

List of all members.


Detailed Description

The listener interface for receiving keyboard events (keystrokes).

The class that is interested in processing a keyboard event either implements this interface (and all the methods it contains) or extends the abstract KeyAdapter class (overriding only the methods of interest).

The listener object created from that class is then registered with a component using the component's addKeyListener method. A keyboard event is generated when a key is pressed, released, or typed (pressedn and released). The relevant method in the listener object is then invoked, and the KeyEvent is passed to it.

Author:
Carl Quinn
Version:
1.16 01/23/03
See also:
KeyAdapter

KeyEvent

Tutorial: Writing a Key Listener

Reference: The Java Class Libraries (update file)

Since:
1.1

Public Member Functions

virtual void keyTyped (const KeyEvent &e)=0
 Invoked when a key has been typed.
virtual void keyPressed (const KeyEvent &e)=0
 Invoked when a key has been pressed.
virtual void keyReleased (const KeyEvent &e)=0
 Invoked when a key has been released.

Member Function Documentation

virtual void java::awt::event::KeyListener::keyTyped ( const KeyEvent e  )  [pure virtual]

Invoked when a key has been typed.

See the class description for KeyEvent for a definition of a key typed event.

Implemented in java::awt::event::KeyAdapter.

virtual void java::awt::event::KeyListener::keyPressed ( const KeyEvent e  )  [pure virtual]

Invoked when a key has been pressed.

See the class description for KeyEvent for a definition of a key pressed event.

Implemented in java::awt::event::KeyAdapter.

virtual void java::awt::event::KeyListener::keyReleased ( const KeyEvent e  )  [pure virtual]

Invoked when a key has been released.

See the class description for KeyEvent for a definition of a key released event.

Implemented in java::awt::event::KeyAdapter.


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:17 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3