lejos.keyboard
Interface KeyListener


public interface KeyListener

This interface is for classes that wish to receive keyboard events.

Since:
0.6
Author:
BB
See Also:
Keyboard, KeyEvent

Method Summary
 void keyPressed(KeyEvent event)
          This method is called when a key is pressed.
 void keyReleased(KeyEvent event)
          This method is called when a key is released.
 void keyTyped(KeyEvent event)
          This method is called when a key is typed.
 

Method Detail

keyTyped

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. If a key is held down, this event will repeat.

Parameters:
event - the KeyEvent indicating that a key was typed

keyPressed

void keyPressed(KeyEvent event)
This method is called when a key is pressed. A key is the unshifted/unmodified key such as '/' (there can be no '?' key press). In standard Java it will repeat if the key is held down, but in leJOS it is only called once when a key if pressed as this seemed to be more useful.

Parameters:
event - the KeyEvent indicating the key press

keyReleased

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

Parameters:
event - the KeyEvent indicating the key release