diff --git a/src/kernel/KernelEvents.hx b/src/kernel/KernelEvents.hx index b6d7ced..f95ae53 100644 --- a/src/kernel/KernelEvents.hx +++ b/src/kernel/KernelEvents.hx @@ -1,12 +1,11 @@ package kernel; +import lua.TableTools; +import lua.Coroutine; import util.Vec.Vec2; import haxe.Exception; using tink.CoreApi; - -import cc.OS; - using lua.Table; /** @@ -134,7 +133,7 @@ class KernelEvents { **/ public function startEventLoop() { while (true) { - var event:Table = OS.pullEventRaw(); + var event:Table = pullEvents(); var eventName:String = event[1]; @@ -142,6 +141,10 @@ class KernelEvents { } } + private function pullEvents():Table { + return cast TableTools.pack(Coroutine.yield(null)); + } + private function fireSignal(eventName: String,event:Table ) { switch eventName { case "alarm":