diff options
author | chai <chaifix@163.com> | 2018-09-10 19:47:21 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-09-10 19:47:21 +0800 |
commit | d5cda5fddc078fa5fdb93805785fc707f050d8e7 (patch) | |
tree | 46224cbddb79959cbc26f045c757a9dde7ebb23b /src/lua/embed | |
parent | 435e17c1a81fa74a45465829bd42d36e7fa24406 (diff) |
*update
Diffstat (limited to 'src/lua/embed')
-rw-r--r-- | src/lua/embed/boot.lua.h | 5 | ||||
-rw-r--r-- | src/lua/embed/keyboard.lua.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/lua/embed/boot.lua.h b/src/lua/embed/boot.lua.h index f7ffc43..35bfdfc 100644 --- a/src/lua/embed/boot.lua.h +++ b/src/lua/embed/boot.lua.h @@ -45,9 +45,9 @@ function jin.core.run() local current = previous while jin.core.running() do for _, e in pairs(jin.event.poll()) do - if e.type == "keydown" then + if e.type == "KeyDown" then jin.keyboard.set(e.key, true) - elseif e.type == "keyup" then + elseif e.type == "KeyUp" then jin.keyboard.set(e.key, false) end call(jin.core.onEvent, e) @@ -78,6 +78,7 @@ jin.core.setHandler = function(handler) jin.core.onDraw = handler.onDraw end +-- TODO: Ĭͼbase64 jin.nogame = { cs = 64, sw = jin.graphics.getWidth(), diff --git a/src/lua/embed/keyboard.lua.h b/src/lua/embed/keyboard.lua.h index 77bf3a9..ee8428f 100644 --- a/src/lua/embed/keyboard.lua.h +++ b/src/lua/embed/keyboard.lua.h @@ -4,7 +4,7 @@ jin.keyboard = jin.keyboard or {} local keys = {} -function jin.keyboard.isDown(k) +function jin.keyboard.isPressed(k) return keys[k] end |