# jquery-common-keydown

> jQuery collection plugin that triggers events for common accessibility keys e.g. ENTER, SPACE, ESC, ARROW KEYS.

Latest version **1.0.1** (published 2017-10-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install jquery-common-keydown
pnpm add jquery-common-keydown
yarn add jquery-common-keydown
bun add jquery-common-keydown
```

## 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.0.1 |
| Published | 2017-10-17 |
| First published | 2016-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ian McBurnie |
| Maintainers | ianmcburnie |
| Keywords | jquery-plugin, ecosystem:jquery, ebay, accessibility, a11y |

## Links

- npm: https://www.npmjs.com/package/jquery-common-keydown
- Repository: https://github.com/makeup-jquery/jquery-common-keydown
- Homepage: https://github.com/makeup-jquery/jquery-common-keydown#readme
- Issues: https://github.com/makeup-jquery/jquery-common-keydown/issues
- npm.io page: https://npm.io/package/jquery-common-keydown

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2017-10-17
- 1.0.0 — 2017-10-16
- 0.3.1 — 2016-09-29
- 0.3.0 — 2016-09-16
- 0.2.2 — 2016-07-08
- 0.2.1 — 2016-07-08
- 0.2.0 — 2016-07-08
- 0.1.1 — 2016-06-17
- 0.1.0 — 2016-06-17
- 0.0.4 — 2016-03-16
- 0.0.3 — 2016-03-16
- 0.0.2 — 2016-03-15

## README

# jquery-common-keydown

<p>
    <a href="https://travis-ci.org/makeup-jquery/jquery-common-keydown"><img src="https://api.travis-ci.org/makeup-jquery/jquery-common-keydown.svg?branch=master" alt="Build Status" /></a>
    <a href='https://coveralls.io/github/makeup-jquery/jquery-common-keydown?branch=master'><img src='https://coveralls.io/repos/makeup-jquery/jquery-common-keydown/badge.svg?branch=master&service=github' alt='Coverage Status' /></a>
    <a href="https://david-dm.org/makeup-jquery/jquery-common-keydown"><img src="https://david-dm.org/makeup-jquery/jquery-common-keydown.svg" alt="Dependency status" /></a>
    <a href="https://david-dm.org/makeup-jquery/jquery-common-keydown#info=devDependencies"><img src="https://david-dm.org/makeup-jquery/jquery-common-keydown/dev-status.svg" alt="devDependency status" /></a>
</p>

jQuery collection plugin that adds observer for common accessibility keydown event, e.g. enter, space, esc, arrows.

```js
$(collection).commonKeyDown();
```

## Install

```js
npm install jquery-common-keydown
```

## Example

```html
<ul>
    <li><button>Button 1</button></li>
    <li><button>Button 2</button></li>
    <li><button>Button 3</button></li>
</ul>
```

```js
// non-delegated event listener
$('ul').commonKeyDown().on('spaceKeyDown enterKeyDown', function(e) {
    // this = ul
    // e.target = button
});
// delegated event listener
$('ul').commonKeyDown().on('spaceKeyDown enterKeyDown', 'button', function(e) {
    // this = button
    // e.target = button
});
```

## Events

* `enterKeyDown`
* `escapeKeyDown`
* `spaceKeyDown`
* `pageUpKeyDown`
* `pageDownKeyDown`
* `endKeyDown`
* `homeKeyDown`
* `leftArrowKeyDown`
* `upArrowKeyDown`
* `rightArrowKeyDown`
* `downArrowKeyDown`

## Constants

```js
$.fn.commonKeyDown.keyCodes = {
    ENTER: 13,
    ESCAPE: 27,
    SPACE: 32,
    PAGEUP: 33,
    PAGEDOWN: 34,
    END: 35,
    HOME: 36,
    LEFTARROW: 37,
    UPARROW: 38,
    RIGHTARROW: 39,
    DOWNARROW: 40
};
```

## Development

Run `npm start` for browser based development or `npm run tdd` for test driven development. All tests are located in `test.js`.

Execute `npm run` to view all available CLI scripts:

* `npm start` launch local server and refreshes browser on any source file change
* `npm test` runs tests & generates reports (see reports section below)
* `npm run tdd` test driven development: watches code and re-tests after any change
* `npm run lint` lints code and reports to lint.txt
* `npm run build` cleans, lints, tests and minifies (called on `npm prepublish` hook)
* `npm run clean` deletes all generated test reports and coverage files

## Reports

Each test run will generate the following reports:

* `/test_reports/coverage` contains Istanbul code coverage report
* `/test_reports/html` contains HTML test report
* `/test_reports/junit` contains JUnit test report

## CI Build

https://travis-ci.org/makeup-jquery/jquery-common-keydown

## Code Coverage

https://coveralls.io/github/makeup-jquery/jquery-common-keydown?branch=master

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