diff options
Diffstat (limited to 'NET/worlds/scape/KeyEvent.java')
| -rw-r--r-- | NET/worlds/scape/KeyEvent.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/NET/worlds/scape/KeyEvent.java b/NET/worlds/scape/KeyEvent.java new file mode 100644 index 0000000..cff81f8 --- /dev/null +++ b/NET/worlds/scape/KeyEvent.java @@ -0,0 +1,19 @@ +package NET.worlds.scape; + +public class KeyEvent extends UserEvent { + char key; + + public KeyEvent(int time, Object source, WObject target, char key) { + super(time, source, target); + this.key = key; + } + + @Override + public boolean deliver(Object o) { + return o instanceof KeyHandler && ((KeyHandler)o).handle(this) ? true : super.deliver(o); + } + + public char getKey() { + return this.key; + } +} |