com.jmex.bui.event
Class KeyEvent
java.lang.Object
java.util.EventObject
com.jmex.bui.event.BEvent
com.jmex.bui.event.InputEvent
com.jmex.bui.event.KeyEvent
- All Implemented Interfaces:
- Serializable
public class KeyEvent
- extends InputEvent
Encapsulates the information associated with a keyboard event.
- See Also:
- Serialized Form
|
Field Summary |
protected char |
_keyChar
|
protected int |
_keyCode
|
protected int |
_type
|
static int |
KEY_PRESSED
Indicates that an event represents a key pressing. |
static int |
KEY_RELEASED
Indicates that an event represents a key release. |
| Fields inherited from class com.jmex.bui.event.BEvent |
_when |
|
Constructor Summary |
KeyEvent(Object source,
long when,
int modifiers,
int type,
char keyChar,
int keyCode)
|
KEY_PRESSED
public static final int KEY_PRESSED
- Indicates that an event represents a key pressing.
- See Also:
- Constant Field Values
KEY_RELEASED
public static final int KEY_RELEASED
- Indicates that an event represents a key release.
- See Also:
- Constant Field Values
_type
protected int _type
_keyChar
protected char _keyChar
_keyCode
protected int _keyCode
KeyEvent
public KeyEvent(Object source,
long when,
int modifiers,
int type,
char keyChar,
int keyCode)
getType
public int getType()
- Indicates whether this was a
KEY_PRESSED or KEY_RELEASED event.
getKeyChar
public char getKeyChar()
- Returns the character associated with the key. Note: this
is only valid for
KEY_PRESSED events, however getKeyCode() works in all cases.
getKeyCode
public int getKeyCode()
- Returns the numeric identifier associated with the key.
- See Also:
KeyInput
dispatch
public void dispatch(ComponentListener listener)
- Description copied from class:
BEvent
- Instructs this event to notify the supplied listener if they
implement an interface appropriate to this event.
- Overrides:
dispatch in class BEvent
toString
protected void toString(StringBuffer buf)
- Overrides:
toString in class InputEvent
Copyright © 2008 Michael Bayne.
All Rights Reserved.