JS snippet to watch for keyboard command,s, and fire events based on them