Snippet for capturing keyboard keys with Javascript (unfinshed)