Keybind = {} Keybind.move = {} Keybind.menu = {} Keybing.debug = {} function Keybind:Check(action) for _, keyname in pairs(action) do if type(keyname) == "string" then if love.keyboard.isDown(keyname) then return true end else if love.mouse.isDown(keyname) then return true end end end return false end function Keybind:Colision(cat, key) for _, action in pairs(cat) do for _, keyname in pairs(action) do if key == keyname then return true end end end return false end function Keybind:Add(action, key) table.insert(action, key) end function Keybind:Change(action, position, key) action[position] = key end function Keybind:Remove(action) action = {} end function Keybind:Default() --Menu Keybind.menu.menu = {"escape"} --Move Keybind.move.left = {"left", "a"} Keybind.move.right = {"right", "d"} Keybind.move.up = {"up", "w"} Keybind.move.down = {"down", "s"} Keybind.move.jump = {"z", "space"} Keybind.move.attack = {"x", 1} Keybind.move.dash = {"c", 2} --Debug Keybind.debug.debug = {"f1"} Keybind.debug.reposition = {"f2"} Keybind.debug.reload = {"f3"} Keybind.debug.editor = {"f4"} end -- Set default values at start Keybind:Default()