diff --git a/gamecore/input.lua b/gamecore/input.lua index 1027a28..539e8f8 100644 --- a/gamecore/input.lua +++ b/gamecore/input.lua @@ -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 diff --git a/gamecore/modules/scenes.lua b/gamecore/modules/scenes.lua index 7bca6c0..3ae1f46 100644 --- a/gamecore/modules/scenes.lua +++ b/gamecore/modules/scenes.lua @@ -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