Skip to content

Latest commit

 

History

History
41 lines (25 loc) · 479 Bytes

readme.md

File metadata and controls

41 lines (25 loc) · 479 Bytes

keyboard-key-code

Helper methods for dealing with key codes in keyboard events.

Install

npm i keyboard-key-code

Usage

import * as keyCode from 'keyboard-key-code'
keyCode.isTab({
  which: 9
})
// => true

API

is(event, code)

isArrowDown(event)

isArrowUp(event)

isEsc(event)

isEnter(event)

isSpace(event)

isSpaceOrEnter(event)

isTab(event)

License

MIT © Emil Johansson