Keyprress how to use it right

const EscapeListen = React.createClass({
  handleKeyDown: function(e) {
    if (e.keyCode === 27) {
      console.log('You pressed the escape key!')
    }
  },

  render: function() {
    return (
      <input type='text'
             onKeyDown={this.handleKeyDown} />
    )
  }
})

I want to know how to make a code in wich you press the key and get what you want without getting a form. I want to see nothing…

This would be an example of how to get key events without an input.

thank you !! you helped me to complete the drum machine challenger