From bca366d7e5e57ed96c9e604510f6272676cec8b9 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Tue, 1 Mar 2022 13:21:35 +0100 Subject: [PATCH] pull events native --- src/kernel/KernelEvents.hx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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":