Skip to content

Instantly share code, notes, and snippets.

@squarism
Created April 11, 2011 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squarism/914276 to your computer and use it in GitHub Desktop.
Save squarism/914276 to your computer and use it in GitHub Desktop.
ruby-processing keyCode for key_pressed
# 38up 39right 40down 37left
def key_pressed
case key_code
when 32
puts 'space'
when 37
puts 'left'
when 38
puts 'up'
when 39
puts 'right'
when 40
puts 'down'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment