jcontrol.ui.vole.event
Class KeyEvent

java.lang.Object
  |
  +--jcontrol.ui.vole.event.KeyEvent

public class KeyEvent
extends java.lang.Object

This event may be generated when a Keyboard key is pressed. It should be sent to the top level component to be automatically passed through the focus path down to a basic component, for example a button. Until now, the KeyEvent must be generated manually, which is mostly done by continuously requesting the Keyboard by calling readKey.

Since:
Yogi2
Version:
1.0
Author:
Marcus Timmermann
See Also:
Keyboard

Field Summary
(package private)  int key
           
static int KEY_FOCUS_BACKWARD
          Key function 'transfer focus backward'
static int KEY_FOCUS_FORWARD
          Key function 'transfer focus forward'
static int KEY_PRESSED
          Indicate that a key was pressed
static int KEY_RELEASED
          Indicate that a key has been released
static int KEY_SCROLL_DOWN
          Key function 'scroll down'
static int KEY_SCROLL_UP
          Key function 'scroll up'
static int KEY_SELECT
          Key function 'select'
(package private)  int type
           
 
Constructor Summary
KeyEvent(int type, int key)
          Constructs a KeyEvent.
 
Method Summary
 int getKey()
          Get event's function
 int getType()
          Get event's type (may be undefined)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, notifyAll, wait
 

Field Detail

key

int key

KEY_FOCUS_BACKWARD

public static final int KEY_FOCUS_BACKWARD
Key function 'transfer focus backward'

See Also:
Constant Field Values

KEY_FOCUS_FORWARD

public static final int KEY_FOCUS_FORWARD
Key function 'transfer focus forward'

See Also:
Constant Field Values

KEY_PRESSED

public static final int KEY_PRESSED
Indicate that a key was pressed

See Also:
Constant Field Values

KEY_RELEASED

public static final int KEY_RELEASED
Indicate that a key has been released

See Also:
Constant Field Values

KEY_SCROLL_DOWN

public static final int KEY_SCROLL_DOWN
Key function 'scroll down'

See Also:
Constant Field Values

KEY_SCROLL_UP

public static final int KEY_SCROLL_UP
Key function 'scroll up'

See Also:
Constant Field Values

KEY_SELECT

public static final int KEY_SELECT
Key function 'select'

See Also:
Constant Field Values

type

int type
Constructor Detail

KeyEvent

public KeyEvent(int type,
                int key)
Constructs a KeyEvent.

Parameters:
type - The KeyEvent type (KEY_PRESSED, KEY_RELEASED)
key - The key function that was pressed
Method Detail

getKey

public int getKey()
Get event's function


getType

public int getType()
Get event's type (may be undefined)