gamecore/input: fix two glitches in the key flushing system
This commit is contained in:
parent
80ef8b1a65
commit
af96232d53
2 changed files with 7 additions and 8 deletions
|
@ -95,18 +95,17 @@ end
|
||||||
|
|
||||||
function InputManager:flushKeys()
|
function InputManager:flushKeys()
|
||||||
for i,v in ipairs(self.sources) do
|
for i,v in ipairs(self.sources) do
|
||||||
self:flushSourceKeys(sourceid)
|
self:flushSourceKeys(i)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function InputManager:flushSourceKeys(sourceid)
|
function InputManager:flushSourceKeys(sourceid)
|
||||||
self.keys = {}
|
self.keys = {}
|
||||||
for k,v in pairs(self.data[sourceid].keys) do
|
for k,v in pairs(self.sources[sourceid].keys) do
|
||||||
self.keys[k] = {}
|
v = {}
|
||||||
self.keys[k].isDown = false
|
v.isDown = false
|
||||||
self.keys[k].isPressed = false
|
v.isPressed = false
|
||||||
self.keys[k].isReleased = false
|
v.isReleased = false
|
||||||
self.keys[k].test = "ok"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ function Scene:getKeys(sourceid)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Scene:flushKeys()
|
function Scene:flushKeys()
|
||||||
core.input:flushSourceKeys()
|
core.input:flushKeys()
|
||||||
self.sources = core.input:getSources()
|
self.sources = core.input:getSources()
|
||||||
self.inputLockedTimer = 1
|
self.inputLockedTimer = 1
|
||||||
self.inputLocked = true
|
self.inputLocked = true
|
||||||
|
|
Loading…
Reference in a new issue