Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## lejos.devices
Class KeyEvent

    java.lang.Object
      lejos.devices.KeyEvent

    public class KeyEvent

extends Object

Field Summary
`static int` | `ALT_DOWN_MASK`
`static int` | `ALT_GRAPH_DOWN_MASK`
`static int` | `ALT_GRAPH_MASK`
`static int` | `ALT_MASK`
`static int` | `CTRL_DOWN_MASK`
`static int` | `CTRL_MASK`
`static short` | `KEY_PRESSED`
`static short` | `KEY_RELEASED`
`static short` | `KEY_TYPED`
`static int` | `META_DOWN_MASK`
`static int` | `META_MASK`
`static int` | `SHIFT_DOWN_MASK`
`static int` | `SHIFT_MASK`
`static int` | `VK_DOWN` Keycode constant for the down arrow key
`static int` | `VK_LEFT` Keycode constant for the left arrow key
`static int` | `VK_RIGHT` Keycode constant for the right arrow key
`static int` | `VK_UP` Keycode constant for the up arrow key

Constructor Summary
`KeyEvent(Object source, short id, int when, int modifiers, int keyCode, char keyChar)`

Method Summary
`void` | `consume()`
`int` | `getID()`
`char` | `getKeyChar()`
`int` | `getKeyCode()` Will actually only return key codes that don't have ASCII/Unicode equivalents, such as arrow keys (e.g.
`int` | `getKeyLocation()` Not Implemented
`int` | `getModifiers()`
`Object` | `getSource()`
`int` | `getWhen()`
`boolean` | `isAltDown()`
`boolean` | `isAltGraphDown()`
`boolean` | `isConsumed()`
`boolean` | `isControlDown()`
`boolean` | `isMetaDown()`
`boolean` | `isShiftDown()`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait`

Field Detail

### SHIFT_MASK

    public static final int SHIFT_MASK

See Also:
  Constant Field Values

### CTRL_MASK

    public static final int CTRL_MASK

See Also:
  Constant Field Values

### META_MASK

    public static final int META_MASK

See Also:
  Constant Field Values

### ALT_MASK

    public static final int ALT_MASK

See Also:
  Constant Field Values

### ALT_GRAPH_MASK

    public static final int ALT_GRAPH_MASK

See Also:
  Constant Field Values

### SHIFT_DOWN_MASK

    public static final int SHIFT_DOWN_MASK

See Also:
  Constant Field Values

### CTRL_DOWN_MASK

    public static final int CTRL_DOWN_MASK

See Also:
  Constant Field Values

### META_DOWN_MASK

    public static final int META_DOWN_MASK

See Also:
  Constant Field Values

### ALT_DOWN_MASK

    public static final int ALT_DOWN_MASK

See Also:
  Constant Field Values

### ALT_GRAPH_DOWN_MASK

    public static final int ALT_GRAPH_DOWN_MASK

See Also:
  Constant Field Values

### VK_DOWN

    public static final int VK_DOWN

  Keycode constant for the down arrow key

  See Also:
    Constant Field Values

### VK_RIGHT

    public static final int VK_RIGHT

  Keycode constant for the right arrow key

  See Also:
    Constant Field Values

### VK_UP

    public static final int VK_UP

  Keycode constant for the up arrow key

  See Also:
    Constant Field Values

### VK_LEFT

    public static final int VK_LEFT

  Keycode constant for the left arrow key

  See Also:
    Constant Field Values

### KEY_TYPED

    public static short KEY_TYPED

### KEY_PRESSED

    public static short KEY_PRESSED

### KEY_RELEASED

    public static short KEY_RELEASED

Constructor Detail

### KeyEvent

    public KeyEvent(Object source,
                    short id,
                    int when,
                    int modifiers,
                    int keyCode,
                    char keyChar)

Method Detail

### getKeyChar

    public char getKeyChar()

### getKeyCode

    public int getKeyCode()

  Will actually only return key codes that don't have ASCII/Unicode equivalents, such as arrow keys (e.g. VK_UP). Otherwise it just returns the ASCII value.

  Returns:
    the key code

### getKeyLocation

    public int getKeyLocation()

  Not Implemented

  Returns:
    0

### getID

    public int getID()

### isShiftDown

    public boolean isShiftDown()

### isControlDown

    public boolean isControlDown()

### isMetaDown

    public boolean isMetaDown()

### isAltDown

    public boolean isAltDown()

### isAltGraphDown

    public boolean isAltGraphDown()

### getWhen

    public int getWhen()

### getModifiers

    public int getModifiers()

### consume

    public void consume()

### isConsumed

    public boolean isConsumed()

### getSource

    public Object getSource()

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD