diff options
Diffstat (limited to 'NET/worlds/scape/EventQueue.java')
| -rw-r--r-- | NET/worlds/scape/EventQueue.java | 220 |
1 files changed, 220 insertions, 0 deletions
diff --git a/NET/worlds/scape/EventQueue.java b/NET/worlds/scape/EventQueue.java new file mode 100644 index 0000000..9bfb888 --- /dev/null +++ b/NET/worlds/scape/EventQueue.java @@ -0,0 +1,220 @@ +/* */ package NET.worlds.scape; +/* */ +/* */ import NET.worlds.core.Std; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class EventQueue +/* */ { +/* */ private static final int keyDown = 1; +/* */ private static final int keyUp = 2; +/* */ private static final int keyChar = 3; +/* */ private static final int mouseDown = 4; +/* */ private static final int mouseUp = 5; +/* */ private static final int mouseMove = 6; +/* */ private static final int mouseDelta = 7; +/* */ private static final int mouseEnter = 8; +/* */ private static final int mouseExit = 9; +/* */ private static final int teleport = 10; +/* */ private char key; +/* */ private int type; +/* */ private int time; +/* */ private int x; +/* */ private int y; +/* */ +/* */ public static void pollForEvents(Camera eventEater) +/* */ { +/* 58 */ if (eventEater != null) +/* */ { +/* */ +/* */ +/* */ +/* 63 */ int eventCount = getEventCount(); +/* */ Event e; +/* 65 */ while ((eventCount-- > 0) && ((e = dequeueInfo.dequeue()) != null)) { Event e; +/* 66 */ if (e.target == null) +/* 67 */ e.target = eventEater; +/* 68 */ eventEater.deliver(e); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static boolean redirectDrivingKeys(java.awt.Event e) +/* */ { +/* */ boolean press; +/* */ +/* */ +/* */ +/* 82 */ if (((press = e.id == 403 ? 1 : 0) != 0) || (e.id == 404)) { char newKey; +/* */ char newKey; +/* 84 */ char newKey; char newKey; char newKey; char newKey; char newKey; char newKey; char newKey; switch (e.key) { +/* */ case 1004: +/* 86 */ newKey = 58150; +/* 87 */ break; +/* */ case 1005: +/* 89 */ newKey = 58152; +/* 90 */ break; +/* */ case 1006: +/* 92 */ newKey = 58149; +/* 93 */ break; +/* */ case 1007: +/* 95 */ newKey = 58151; +/* 96 */ break; +/* */ case 1002: +/* 98 */ newKey = 58145; +/* 99 */ break; +/* */ case 1003: +/* 101 */ newKey = 58146; +/* 102 */ break; +/* */ case 1000: +/* 104 */ newKey = 58148; +/* 105 */ break; +/* */ case 1001: +/* 107 */ newKey = 58147; +/* 108 */ break; +/* */ case 27: +/* 110 */ newKey = 58139; +/* 111 */ break; +/* */ default: +/* 113 */ return false; } +/* */ char newKey; +/* 115 */ addEvent(newKey, press ? 1 : 2, +/* 116 */ Std.getTimeZero() + Std.getRealTime(), +/* 117 */ e.x, e.y); +/* 118 */ return true; +/* */ } +/* 120 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 151 */ private static EventQueue dequeueInfo = new EventQueue(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private Event dequeue() +/* */ { +/* 170 */ if (getNextEvent()) +/* */ { +/* */ +/* */ +/* 174 */ this.time -= Std.getTimeZero(); +/* */ +/* 176 */ switch (this.type) { +/* */ case 1: +/* 178 */ return new KeyDownEvent(this.time, null, this.key); +/* */ case 2: +/* 180 */ return new KeyUpEvent(this.time, null, this.key); +/* */ case 3: +/* 182 */ return new KeyCharEvent(this.time, null, this.key); +/* */ case 4: +/* 184 */ return new MouseDownEvent(this.time, null, this.key, this.x, this.y); +/* */ case 5: +/* 186 */ return new MouseUpEvent(this.time, null, this.key, this.x, this.y); +/* */ case 6: +/* 188 */ return new MouseMoveEvent(this.time, null, this.x, this.y); +/* */ case 7: +/* 190 */ return new MouseDeltaEvent(this.time, null, this.x, this.y); +/* */ case 8: +/* 192 */ return new MouseEnterEvent(this.time, null, this.x, this.y); +/* */ case 9: +/* 194 */ return new MouseExitEvent(this.time, null, this.x, this.y); +/* */ } +/* 196 */ throw new Error("Illegal internal event type"); +/* */ } +/* */ +/* 199 */ return null; +/* */ } +/* */ +/* */ static +/* */ { +/* 204 */ nativeInit(); +/* */ } +/* */ +/* */ public static native void nativeInit(); +/* */ +/* */ private native boolean getNextEvent(); +/* */ +/* */ private static native int getEventCount(); +/* */ +/* */ private static native void addEvent(char paramChar, int paramInt1, int paramInt2, int paramInt3, int paramInt4); +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\EventQueue.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |