diff --git a/code/keybind.lua b/code/keybind.lua index 9787bb0..5ddcfc9 100644 --- a/code/keybind.lua +++ b/code/keybind.lua @@ -27,12 +27,17 @@ function Keybind:CheckDown(action) return false else for _, keyname in pairs(action.keys) do - local fn = love.keyboard.isDown - if not type(keyname) == "string" then - local fn = love.mouse.isDown + local check = false + if type(keyname) == "string" then + check = love.keyboard.isDown(keyname) + else + check = love.mouse.isDown(keyname) end - if fn(keyname) then - Demo:RecordAction(action.demo) + + if check then + if action.demo ~= nil then + Demo:RecordAction(action.demo) + end return true end end