org.gnu.gtk.event
public class KeyEvent extends GtkEvent
Deprecated: This class is part of the java-gnome 2.x family of libraries, which, due to their inefficiency and complexity, are no longer being maintained and have been abandoned by the java-gnome project. Signal handling an connection has been completely re-implemented in java-gnome 4.0, so you will need to refactor any code attempting to use this class.
This event object is used to identify when a key has been pressed and released. In particular, it allows you to get at which key was pressed - see getKeyval.| Nested Class Summary | |
|---|---|
| static class | KeyEvent.Type |
| Constructor Summary | |
|---|---|
| KeyEvent(Object source, KeyEvent.Type type, EventKey gdkEvent)
Construct a KeyEvent object. | |
| Method Summary | |
|---|---|
| int | getKeyval()
Returns the key value. |
| int | getLength()
Returns the length of the String that resulted from this keypress (see
getString).
|
| ModifierType | getModifierKey()
Returns the modifier key used.
|
| String | getString()
Get the "null-terminated multi-byte string containing the composed
characters resulting from the key press".
|
| boolean | isOfType(KeyEvent.Type test)
Test to compare events. |
Deprecated: Superceeded by java-gnome 4.0; Signals all have individual interfaces each with a single method corresponding to the signature of the underlying callback.
Construct a KeyEvent object.Deprecated: Superceeded by java-gnome 4.0; Signals all have individual interfaces each with a single method corresponding to the signature of the underlying callback.
Returns the key value. Example:
if (key == KeyValue.Return) {
...
}
Returns: an int, the key value. See KeyValue for the comprehensive list of values.
Deprecated: Superceeded by java-gnome 4.0; Signals all have individual interfaces each with a single method corresponding to the signature of the underlying callback.
Returns the length of the String that resulted from this keypress (see getString).Returns: int
Deprecated: Superceeded by java-gnome 4.0; Signals all have individual interfaces each with a single method corresponding to the signature of the underlying callback.
Returns the modifier key used.Returns: (see ModifierType)
Deprecated: Superceeded by java-gnome 4.0; Signals all have individual interfaces each with a single method corresponding to the signature of the underlying callback.
Get the "null-terminated multi-byte string containing the composed characters resulting from the key press".FIXME: Isn't null termination hidden in Java? And, in any case, characters in Strings in Java are multi-byte. So does this work right nor not?
Returns: String the character(s) resulting from the key press.
Deprecated: Superceeded by java-gnome 4.0; Signals all have individual interfaces each with a single method corresponding to the signature of the underlying callback.
Test to compare events.