Skip to content

Instantly share code, notes, and snippets.

@codeliger
Last active August 29, 2015 14:11
Show Gist options
  • Save codeliger/974020d8812cebb008b5 to your computer and use it in GitHub Desktop.
Save codeliger/974020d8812cebb008b5 to your computer and use it in GitHub Desktop.
-- Listen for keypresses
function love.keypressed(key)
local switch = {
escape = love.event.quit
}
if(type(switch[key]) == "function") then
switch[key]()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment