All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.event.KeyEvent

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----java.awt.AWTEvent
                   |
                   +----java.awt.event.ComponentEvent
                           |
                           +----java.awt.event.InputEvent
                                   |
                                   +----java.awt.event.KeyEvent

public class KeyEvent
extends InputEvent
The component-level keyboard event.


Variable Index

 o BACK_SPACE
The BackSpace key.
 o CAPS_LOCK
The CapsLock action-key.
 o DELETE
The Delete key.
 o DOWN
The down arrow action-key.
 o END
The end action-key.
 o ENTER
The Enter key.
 o ESCAPE
The Escape key.
 o F1
The F1 function action-key.
 o F10
The F10 function action-key.
 o F11
The F11 function action-key.
 o F12
The F12 function action-key.
 o F2
The F2 function action-key.
 o F3
The F3 function action-key.
 o F4
The F4 function action-key.
 o F5
The F5 function action-key.
 o F6
The F6 function action-key.
 o F7
The F7 function action-key.
 o F8
The F8 function action-key.
 o F9
The F9 function action-key.
 o HOME
The home action-key.
 o INSERT
The Insert action-key.
 o KEY_FIRST
Marks the first integer id for the range of key event ids.
 o KEY_LAST
Marks the last integer id for the range of key event ids.
 o KEY_PRESSED
The key pressed event type.
 o KEY_RELEASED
The key released event type.
 o KEY_TYPED
The key typed event type.
 o LEFT
The left arrow action-key.
 o NUM_LOCK
The NumLock action-key.
 o PAUSE
The Pause action-key.
 o PGDN
The page down action-key.
 o PGUP
The page up action-key.
 o PRINT_SCREEN
The PrintScreen action-key.
 o RIGHT
The right arrow action-key.
 o SCROLL_LOCK
The ScrollLock action-key.
 o TAB
The Tab key.
 o UP
The up arrow action-key.

Constructor Index

 o KeyEvent(Component, int, long, int, int)
Constructs a KeyEvent object with the specified source component, type, modifiers, and key.
 o KeyEvent(Event)
Constructs an KeyEvent object from the parameters of a 1.0-style event.

Method Index

 o getKeyChar()
Returns the character associated with the key in this event.
 o getKeyCode()
Returns the integer key-code associated with the key in this event.
 o isActionKey()
Returns whether or not the key in this event is an "action" key.
 o paramString()
 o setKeyCode(int)
 o setModifiers(int)

Variables

 o KEY_FIRST
  public final static int KEY_FIRST
Marks the first integer id for the range of key event ids.

 o KEY_LAST
  public final static int KEY_LAST
Marks the last integer id for the range of key event ids.

 o KEY_TYPED
  public final static int KEY_TYPED
The key typed event type. This type is generated by a combination of a key press followed by a key release.

 o KEY_PRESSED
  public final static int KEY_PRESSED
The key pressed event type.

 o KEY_RELEASED
  public final static int KEY_RELEASED
The key released event type.

 o HOME
  public final static int HOME
The home action-key.

 o END
  public final static int END
The end action-key.

 o PGUP
  public final static int PGUP
The page up action-key.

 o PGDN
  public final static int PGDN
The page down action-key.

 o UP
  public final static int UP
The up arrow action-key.

 o DOWN
  public final static int DOWN
The down arrow action-key.

 o LEFT
  public final static int LEFT
The left arrow action-key.

 o RIGHT
  public final static int RIGHT
The right arrow action-key.

 o F1
  public final static int F1
The F1 function action-key.

 o F2
  public final static int F2
The F2 function action-key.

 o F3
  public final static int F3
The F3 function action-key.

 o F4
  public final static int F4
The F4 function action-key.

 o F5
  public final static int F5
The F5 function action-key.

 o F6
  public final static int F6
The F6 function action-key.

 o F7
  public final static int F7
The F7 function action-key.

 o F8
  public final static int F8
The F8 function action-key.

 o F9
  public final static int F9
The F9 function action-key.

 o F10
  public final static int F10
The F10 function action-key.

 o F11
  public final static int F11
The F11 function action-key.

 o F12
  public final static int F12
The F12 function action-key.

 o PRINT_SCREEN
  public final static int PRINT_SCREEN
The PrintScreen action-key.

 o SCROLL_LOCK
  public final static int SCROLL_LOCK
The ScrollLock action-key.

 o CAPS_LOCK
  public final static int CAPS_LOCK
The CapsLock action-key.

 o NUM_LOCK
  public final static int NUM_LOCK
The NumLock action-key.

 o PAUSE
  public final static int PAUSE
The Pause action-key.

 o INSERT
  public final static int INSERT
The Insert action-key.

 o ENTER
  public final static int ENTER
The Enter key.

 o BACK_SPACE
  public final static int BACK_SPACE
The BackSpace key.

 o TAB
  public final static int TAB
The Tab key.

 o ESCAPE
  public final static int ESCAPE
The Escape key.

 o DELETE
  public final static int DELETE
The Delete key.

Constructors

 o KeyEvent
  public KeyEvent(Event event)
Constructs an KeyEvent object from the parameters of a 1.0-style event.

Parameters:
event - the old-style event
 o KeyEvent
  public KeyEvent(Component source,
                  int id,
                  long when,
                  int modifiers,
                  int keyCode)
Constructs a KeyEvent object with the specified source component, type, modifiers, and key.

Parameters:
source - the object where the event originated

Methods

 o getKeyCode
  public int getKeyCode()
Returns the integer key-code associated with the key in this event. If the key in this event is an "action" key, it returns the action key code defined by this class.

 o setKeyCode
  public void setKeyCode(int keyCode)
 o setModifiers
  public void setModifiers(int modifiers)
 o getKeyChar
  public char getKeyChar()
Returns the character associated with the key in this event.

 o isActionKey
  public boolean isActionKey()
Returns whether or not the key in this event is an "action" key.

 o paramString
  public String paramString()
Overrides:
paramString in class ComponentEvent

All Packages  Class Hierarchy  This Package  Previous  Next  Index