|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--staffui.MagicKeyListener
A MagicKeyListener is decorator for a KeyListener.
This class adds three pieces of functionality. First, it delays key events (moving them to the back of the event queue). Second, it maintains state so that when a press-and-release event pair is sitting in the queue, neither event is propogated to the adaptee (decoratee). Finally, it can (optionally) add to the semantics so that any release event implies that any still-pressed keys have also been released.
Together, these additions may provide more meaningful semantics of key listening in an environment where a key being held down generates repeated key events, or where multiple keys pressed generate a release event for only one of them.
| Constructor Summary | |
MagicKeyListener(KeyListener adaptee)
creates a new MagicKeyListener without the generation of additional key release events (the third option given in the class overview is disabled). |
|
MagicKeyListener(KeyListener adaptee,
boolean assumeAllReleased)
creates a new MagicKeyListener. |
|
| Method Summary | |
void |
keyPressed(KeyEvent e)
Acts on the given event as specified in the class overview. |
void |
keyReleased(KeyEvent e)
Acts on the given event as specified in the class overview. |
void |
keyTyped(KeyEvent e)
Acts on the given event as specified in the class overview |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public MagicKeyListener(KeyListener adaptee)
public MagicKeyListener(KeyListener adaptee,
boolean assumeAllReleased)
assumeAllReleased - enables the third option listed in the
class overview, namely that any key release event implies that
all keys have been released.| Method Detail |
public void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerpublic void keyTyped(KeyEvent e)
keyTyped in interface KeyListener
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||