org.minueto.handlers
Interface MinuetoKeyboardHandler


public interface MinuetoKeyboardHandler

The MinuetoKeyboardHandler is an interface for receiving a keyboard event (press, release) from a MinuetoWindow and handling it.

In other words, the class that will handle keyboard input from MinuetoWindow must extend this interface. In turn, that class must be registered with the MinuetoEventQueue.

An event is generated everytime the keyboard is pressed and released. When the handle method on the MinuetoEventQueue is invoked, that event is processed and the appropriate method in MinuetoKeyboardHandler is invoked.

Since:
Minueto 0.4
See Also:
MinuetoKeyboard, MinuetoEventQueue

Method Summary
 void handleKeyPress(int value)
          Invoked when a keyboard key is pressed.
 void handleKeyRelease(int value)
          Invoked when a keyboard key is released.
 void handleKeyType(char keyChar)
          Invoked when a keyboard key was typed.
 

Method Detail

handleKeyPress

void handleKeyPress(int value)
Invoked when a keyboard key is pressed. The identity of the key that was pressed is passed throught the method argument. Events of this type are well suited for the controls of a game.

The MinuetoKeyboard class stores the constants used to identify the different keys on the keyboard.

Parameters:
value - int denoting which key was pressed.
See Also:
MinuetoKeyboard

handleKeyRelease

void handleKeyRelease(int value)
Invoked when a keyboard key is released. The identity of the key that was released is passed throught the method argument. Events of this type are well suited for the controls of a game.

The MinuetoKeyboard class stores the constants used to identify the different keys on the keyboard.

Parameters:
value - int denoting which key was released.
See Also:
MinuetoKeyboard

handleKeyType

void handleKeyType(char keyChar)
Invoked when a keyboard key was typed. The identity of the key that was released is passed throught the method argument. Events of this type are well suited for typing text.

Parameters:
keyChar - char denoting the key in this event.
See Also:
MinuetoKeyboard