# @umm/unirx_observablekeyevent

> UniRx wrapper for KeyEvent handling.

Latest version **1.0.1** (published 2018-02-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @umm/unirx_observablekeyevent
pnpm add @umm/unirx_observablekeyevent
yarn add @umm/unirx_observablekeyevent
bun add @umm/unirx_observablekeyevent
```

## 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 | 2018-02-14 |
| First published | 2018-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 16.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 10 |
| Author | Tetsuya Mori |
| Maintainers | fakestarbaby, hanage, kidsstar_system, mkaya, monry, risacankidsstar, takyama |

## Links

- npm: https://www.npmjs.com/package/@umm/unirx_observablekeyevent
- Repository: https://github.com/umm-projects/unirx_observablekeyevent
- Issues: https://github.com/umm-projects/unirx_observablekeyevent/issues
- npm.io page: https://npm.io/package/@umm/unirx_observablekeyevent

## Dependencies (5)

- [ncp](https://npm.io/package/ncp.md) ^2.0.0
- [glob](https://npm.io/package/glob.md) ^7.1.2
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [rimraf](https://npm.io/package/rimraf.md) ^2.6.1
- [@umm/unirx](https://npm.io/package/@umm/unirx.md) ^1.0.3

## Recent versions

- 1.0.1 (latest) — 2018-02-14
- 1.0.0 — 2018-02-14

## README

# unirx_observablekeyevent

* キーボード入力イベントの UniRx ラッパー

## Requirement

* [UniRx](https://github.com/neuecc/unirx) ([umm](https://github.com/umm-projects/unirx))

## Install

```shell
npm install github:umm-projects/unirx_observablekeyevent
```

## Usage

### シンプル版

```csharp
using UniRx;
using UnityEngine;

public class Sample {

    public void Hoge() {
        ObservableKeyEvent.OnKeyAsObservable(KeyCode.A).Subscribe(_ => Debug.Log("A"));
        ObservableKeyEvent.OnKeyDownAsObservable(KeyCode.B).Subscribe(_ => Debug.Log("B"));
        ObservableKeyEvent.OnKeyUpAsObservable(KeyCode.C).Subscribe(_ => Debug.Log("C"));
    }

}
```

* ストリームの Dispose などを自前で行う必要があります

### Component 版

```csharp
using UniRx;
using UniRx.Triggers;
using UnityEngine;

public class Sample : MonoBehaviour {

    private void Start() {
        this.OnKeyAsObservable(KeyCode.A).Subscribe(_ => Debug.Log("A"));
        this.OnKeyDownAsObservable(KeyCode.B).Subscribe(_ => Debug.Log("B"));
        this.OnKeyUpAsObservable(KeyCode.C).Subscribe(_ => Debug.Log("C"));
    }

}
```

* 該当のインスタンスが Destroy されると自動的に購読が Dispose されます

## License

Copyright (c) 2018 Tetsuya Mori

Released under the MIT license, see [LICENSE.txt](LICENSE.txt)

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