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.
-
BACK_SPACE
- The BackSpace key.
-
CAPS_LOCK
- The CapsLock action-key.
-
DELETE
- The Delete key.
-
DOWN
- The down arrow action-key.
-
END
-
The end action-key.
-
ENTER
- The Enter key.
-
ESCAPE
- The Escape key.
-
F1
- The F1 function action-key.
-
F10
- The F10 function action-key.
-
F11
- The F11 function action-key.
-
F12
- The F12 function action-key.
-
F2
- The F2 function action-key.
-
F3
- The F3 function action-key.
-
F4
- The F4 function action-key.
-
F5
- The F5 function action-key.
-
F6
- The F6 function action-key.
-
F7
- The F7 function action-key.
-
F8
- The F8 function action-key.
-
F9
- The F9 function action-key.
-
HOME
-
The home action-key.
-
INSERT
- The Insert action-key.
-
KEY_FIRST
- Marks the first integer id for the range of key event ids.
-
KEY_LAST
- Marks the last integer id for the range of key event ids.
-
KEY_PRESSED
- The key pressed event type.
-
KEY_RELEASED
- The key released event type.
-
KEY_TYPED
- The key typed event type.
-
LEFT
- The left arrow action-key.
-
NUM_LOCK
- The NumLock action-key.
-
PAUSE
- The Pause action-key.
-
PGDN
- The page down action-key.
-
PGUP
- The page up action-key.
-
PRINT_SCREEN
- The PrintScreen action-key.
-
RIGHT
- The right arrow action-key.
-
SCROLL_LOCK
- The ScrollLock action-key.
-
TAB
- The Tab key.
-
UP
- The up arrow action-key.
-
KeyEvent(Component, int, long, int, int)
- Constructs a KeyEvent object with the specified source component,
type, modifiers, and key.
-
KeyEvent(Event)
- Constructs an KeyEvent object from the parameters of a 1.0-style event.
-
getKeyChar()
- Returns the character associated with the key in this event.
-
getKeyCode()
- Returns the integer key-code associated with the key in this event.
-
isActionKey()
- Returns whether or not the key in this event is an "action" key.
-
paramString()
-
-
setKeyCode(int)
-
-
setModifiers(int)
-
KEY_FIRST
public final static int KEY_FIRST
- Marks the first integer id for the range of key event ids.
KEY_LAST
public final static int KEY_LAST
- Marks the last integer id for the range of key event ids.
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.
KEY_PRESSED
public final static int KEY_PRESSED
- The key pressed event type.
KEY_RELEASED
public final static int KEY_RELEASED
- The key released event type.
HOME
public final static int HOME
- The home action-key.
END
public final static int END
- The end action-key.
PGUP
public final static int PGUP
- The page up action-key.
PGDN
public final static int PGDN
- The page down action-key.
UP
public final static int UP
- The up arrow action-key.
DOWN
public final static int DOWN
- The down arrow action-key.
LEFT
public final static int LEFT
- The left arrow action-key.
RIGHT
public final static int RIGHT
- The right arrow action-key.
F1
public final static int F1
- The F1 function action-key.
F2
public final static int F2
- The F2 function action-key.
F3
public final static int F3
- The F3 function action-key.
F4
public final static int F4
- The F4 function action-key.
F5
public final static int F5
- The F5 function action-key.
F6
public final static int F6
- The F6 function action-key.
F7
public final static int F7
- The F7 function action-key.
F8
public final static int F8
- The F8 function action-key.
F9
public final static int F9
- The F9 function action-key.
F10
public final static int F10
- The F10 function action-key.
F11
public final static int F11
- The F11 function action-key.
F12
public final static int F12
- The F12 function action-key.
PRINT_SCREEN
public final static int PRINT_SCREEN
- The PrintScreen action-key.
SCROLL_LOCK
public final static int SCROLL_LOCK
- The ScrollLock action-key.
CAPS_LOCK
public final static int CAPS_LOCK
- The CapsLock action-key.
NUM_LOCK
public final static int NUM_LOCK
- The NumLock action-key.
PAUSE
public final static int PAUSE
- The Pause action-key.
INSERT
public final static int INSERT
- The Insert action-key.
ENTER
public final static int ENTER
- The Enter key.
BACK_SPACE
public final static int BACK_SPACE
- The BackSpace key.
TAB
public final static int TAB
- The Tab key.
ESCAPE
public final static int ESCAPE
- The Escape key.
DELETE
public final static int DELETE
- The Delete key.
KeyEvent
public KeyEvent(Event event)
- Constructs an KeyEvent object from the parameters of a 1.0-style event.
- Parameters:
- event - the old-style event
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
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.
setKeyCode
public void setKeyCode(int keyCode)
setModifiers
public void setModifiers(int modifiers)
getKeyChar
public char getKeyChar()
- Returns the character associated with the key in this event.
isActionKey
public boolean isActionKey()
- Returns whether or not the key in this event is an "action" key.
paramString
public String paramString()
- Overrides:
- paramString in class ComponentEvent
All Packages Class Hierarchy This Package Previous Next Index