|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface KeyListener
This is the listener interface for receiving keyboard events on a Widget.
Objects that are interested in keyboard events should implement this
Interface and then register with the Widget
using the
method.
Widget.addListener(KeyListener)
An example of using this to trap the Escape key:
Window window; ... window.addListener(new KeyListener() { public boolean keyEvent(KeyEvent event) { int key = event.getKeyval(); if (key == KeyValue.Escape) { window.hide(); return true; } else { return false; } } });
KeyEvent
,
The list of KeyEvent types
Method Summary | |
---|---|
boolean |
keyEvent(KeyEvent event)
Deprecated. Superceeded by java-gnome 4.0; this method or constant will no doubt exist conceptually, but it may have a different name or signature in order that the project API is an algorithmic mapping of the underlying native libraries. |
Method Detail |
---|
boolean keyEvent(KeyEvent event)
event
- gives you access to the various methods which help you
identify the keystroke. See KeyEvent.getKeyval()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |