# @f/keychord

> Takes in a keypress/keydown/keyup event and returns a chord striE.g. &#x27;ctrl+shift+t&#x27;

Latest version **1.1.1** (published 2015-12-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @f/keychord
pnpm add @f/keychord
yarn add @f/keychord
bun add @f/keychord
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2015-12-16 |
| First published | 2015-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | f |

## Links

- npm: https://www.npmjs.com/package/@f/keychord
- Repository: https://github.com/micro-js/keychord
- Homepage: https://github.com/micro-js/keychord#readme
- Issues: https://github.com/micro-js/keychord/issues
- npm.io page: https://npm.io/package/@f/keychord

## Dependencies (1)

- [@f/keycodes](https://npm.io/package/@f/keycodes.md) ^1.0.0

## Recent versions

- 1.1.1 (latest) — 2015-12-16
- 1.1.0 — 2015-12-16

## README

# keychord

[![Build status][travis-image]][travis-url]
[![Git tag][git-image]][git-url]
[![NPM version][npm-image]][npm-url]
[![Code style][standard-image]][standard-url]

Takes in a keypress/keydown/keyup event and returns a chord string. E.g. `ctrl+shift+t`

## Installation

    $ npm install @f/keychord

## Usage

```js
var keychord = require('@f/keychord')

function render () {
  return <div onKeypress={handleKeypress} />
}

function handleKeypress (e) {
  switch (keychord(e)) {
    case 'enter':
      // handle enter
      break
    case 'shift+enter':
      // handle shift+enter
      break
    case 'ctrl+up':
      // handle ctrl+up
      break
  }
}
```

## API

### keychord(event)

- `event` - A (https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent)[KeyboardEvent] as in keypress/keyup/keydown.

**Returns:** A keychord string. If only one key is being pressed, just returns the name of that key. If it is a sequence of keys, returns a string of the form 'ctrl+shift+enter'.

## License

MIT

[travis-image]: https://img.shields.io/travis/micro-js/keychord.svg?style=flat-square
[travis-url]: https://travis-ci.org/micro-js/keychord
[git-image]: https://img.shields.io/github/tag/micro-js/keychord.svg
[git-url]: https://github.com/micro-js/keychord
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat
[standard-url]: https://github.com/feross/standard
[npm-image]: https://img.shields.io/npm/v/@f/keychord.svg?style=flat-square
[npm-url]: https://npmjs.org/package/@f/keychord

---
_Source: https://npm.io/package/@f/keychord · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
