Skip to content

Instantly share code, notes, and snippets.

@lmiller1990
Created April 18, 2018 14:56
Show Gist options
  • Select an option

  • Save lmiller1990/e2a28308f6790a63e6b54f7fd1690431 to your computer and use it in GitHub Desktop.

Select an option

Save lmiller1990/e2a28308f6790a63e6b54f7fd1690431 to your computer and use it in GitHub Desktop.
handle(e) {
const evt = e.nativeEvent.inputEvent
if (evt.type === 'KeyboardInputEvent') {
this.setState({ count: this.state.count + 1 })
console.log(`Key pressed. \nkeyCode: ${evt.keyCode}.\nkey: ${evt.key}\neventType: ${evt.eventType}`)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment