keyboard-key-code

2.0.1 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i keyboard-key-code

Weekly Downloads

0

Version

2.0.1

License

MIT

Unpacked Size

6.84 kB

Total Files

7

Last publish

Collaborators

  • emiljohansson