function love.keypressed(key)
if console.active then
console:keypressed(key)
return -- <---should exit function here
end
player:keypressed(key)
--[[
other code etc.... than should only be run when console.active = false
--]]
end
The problem is that the line with "return", should exit the function, and not process any other code when triggered. But even if console.active = true, then everything else gets run afterwards.
Last edited by unixfreak on Mon Aug 06, 2018 12:23 am, edited 1 time in total.
Derp. Ignore this post... i had some keypress input that was placed in some update() functions... hence they were triggering keypresses outside of the love.keypressed() function...
I ended up wrapping the keyboard related code in a block like: