gamecore/input: fix two glitches in the key flushing system

This commit is contained in:
Kazhnuz 2019-05-30 13:49:19 +02:00
parent 80ef8b1a65
commit af96232d53
2 changed files with 7 additions and 8 deletions

View file

@ -95,18 +95,17 @@ end
function InputManager:flushKeys()
for i,v in ipairs(self.sources) do
self:flushSourceKeys(sourceid)
self:flushSourceKeys(i)
end
end
function InputManager:flushSourceKeys(sourceid)
self.keys = {}
for k,v in pairs(self.data[sourceid].keys) do
self.keys[k] = {}
self.keys[k].isDown = false
self.keys[k].isPressed = false
self.keys[k].isReleased = false
self.keys[k].test = "ok"
for k,v in pairs(self.sources[sourceid].keys) do
v = {}
v.isDown = false
v.isPressed = false
v.isReleased = false
end
end

View file

@ -146,7 +146,7 @@ function Scene:getKeys(sourceid)
end
function Scene:flushKeys()
core.input:flushSourceKeys()
core.input:flushKeys()
self.sources = core.input:getSources()
self.inputLockedTimer = 1
self.inputLocked = true