# seal-hotkeys

> 热键模块

Latest version **0.0.1** (published 2016-03-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install seal-hotkeys
pnpm add seal-hotkeys
yarn add seal-hotkeys
bun add seal-hotkeys
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-03-14 |
| First published | 2016-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | tudousi |
| Maintainers | tudou |
| Keywords | seal-hotkeys |

## Links

- npm: https://www.npmjs.com/package/seal-hotkeys
- Repository: https://github.com/tudousi/seal-hotkeys
- Issues: https://github.com/tudousi/seal-hotkeys/issues
- npm.io page: https://npm.io/package/seal-hotkeys

## Recent versions

- 0.0.1 (latest) — 2016-03-14

## README

# seal-hotkeys
热键模块，使用Jquery委托事件进行事件的代理

    * 组合热键绑定
    * 热键删除

## DEMO

```javascript
var hotKey = new SealHotKeys({
    el: "#superMan"     // 设置目标元素为一个textarea
});
hotKey.add("ctrl + a", function(e){     // 当textarea组合键按[ctrl+a]下时触发
    // do something
});
```

## API:

### `add`

增加一个热键绑定，第一个参数是一个组合热键。一般是一个控制键(`shift、ctrl、alt`)加上一个标准键。第二个参数是热键处理函数，用法如下。

```javascript
hotKey.add("ctrl + a", function(e){
    res = 'aha';
});
```

### `remove`

移除一个绑定热键，参数是一个热键组合名称同添加热键，用法如下。

```javascript
hotKey.remove('ctrl + a');
```
### `destroy`

释放所有绑定热键，用法如下。

```javascript
hotKey.destroy()；
```

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