Skip to content
Key code handler
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
get-key-code-test.js
get-key-code.js
index.js
license
package-lock.json
package.json
readme.md
test.js

readme.md

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

You can’t perform that action at this time.