# touch-input

> State-based touch input manager for games and high-fidelity interfaces

Latest version **1.0.1** (published 2015-07-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install touch-input
pnpm add touch-input
yarn add touch-input
bun add touch-input
```

## 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 | 2015-07-14 |
| First published | 2015-07-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Harald Kirschner |
| Maintainers | digitarald |

## Links

- npm: https://www.npmjs.com/package/touch-input
- npm.io page: https://npm.io/package/touch-input

## Recent versions

- 1.0.1 (latest) — 2015-07-14
- 1.0.0 — 2015-07-14

## README

# State-based Touch Input Manager

[![NPM version](http://img.shields.io/npm/v/touch-input.svg?style=flat)](https://www.npmjs.org/package/touch-input)
[![Dependency Status](http://img.shields.io/gemnasium/digitarald/touch-input.svg?style=flat)](https://gemnasium.com/digitarald/touch-input)

Gives you the status of all touches during the last frame. Each `Touch` entry represents a status of a finger touching the screen. Touch events are collected between frames and fire custom events once on `requestAnimationFrame`.

Inspired by Unity's [`Input.touches`](http://docs.unity3d.com/ScriptReference/Input-touches.html).

## Goals

* **60fps-first** – Your code should never handle touch events between frames.
* **Only order what you can eat** – One touch event per *touch* per *frame*.

## Examples

* [Immediate using state](http://digitarald.github.io/touch-input/examples/immediate/) – State-based renderer using 2D Canvas
* [DOM-based using events](http://digitarald.github.io/touch-input/examples/events/) – DOM-based renderer using 2D Canvas

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