# aframe-gaze-control-component

> Look control that interprets gaze data as input.

Latest version **1.0.0** (published 2017-07-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install aframe-gaze-control-component
pnpm add aframe-gaze-control-component
yarn add aframe-gaze-control-component
bun add aframe-gaze-control-component
```

## 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.0 |
| Published | 2017-07-18 |
| First published | 2017-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | jsimonson2013@gmail.com |
| Maintainers | jsimonson |
| Keywords | aframe, aframe-component, aframe-vr, vr, mozvr, webvr, gaze-control |

## Links

- npm: https://www.npmjs.com/package/aframe-gaze-control-component
- Repository: https://github.com/jsimonson2013/aframe-gaze-component
- Homepage: https://github.com/jsimonson2013/aframe-gaze-component#readme
- Issues: https://github.com/jsimonson2013/aframe-gaze-component/issues
- npm.io page: https://npm.io/package/aframe-gaze-control-component

## Recent versions

- 1.0.0 (latest) — 2017-07-18

## README

## aframe-gaze-control-component

[![Version](http://img.shields.io/npm/v/aframe-gaze-control-component.svg?style=flat-square)](https://npmjs.org/package/aframe-gaze-control-component)
[![License](http://img.shields.io/npm/l/aframe-gaze-control-component.svg?style=flat-square)](https://npmjs.org/package/aframe-gaze-control-component)

Look control that interprets gaze data as input.

### Usage

Usage requires Node.JS as well as Firefox.

* clone the repository: `git clone https://github.com/jsimonson2013/aframe-gaze-component.git`
* navigate to the root: `cd aframe-gaze-component`
* install packages: `npm install`
* run the application: `npm run start`

For [A-Frame](https://aframe.io).

### API

Create an event
```
var event = new CustomEvent('gazemove', {
  detail: {
    'x': gaze_x,
    'y': gaze_y,
  },
  bubbles: true,
  cancelable: true
});
event.initEvent('gazemove', true, true);
```

Then dispatch to `sceneEl.canvas` every time the gaze moves
```
if(data != null){
  event.detail.x = data.x;
  event.detail.y = data.y;
  canvasEl.dispatchEvent(event);
}
```

### Installation

#### Browser

Install and use by directly including the [browser files](dist):

```html
<head>
  <title>My A-Frame Scene</title>
  <script src="https://aframe.io/releases/0.5.0/aframe.min.js"></script>
  <script src="https://unpkg.com/aframe-gaze-control-component/dist/aframe-gaze-control-component.min.js"></script>
</head>

<body>
  <a-scene>
    <a-entity gaze-control=""></a-entity>
  </a-scene>
</body>
```

<!-- If component is accepted to the Registry, uncomment this. -->
<!--
Or with [angle](https://npmjs.com/package/angle/), you can install the proper
version of the component straight into your HTML file, respective to your
version of A-Frame:

```sh
angle install aframe-gaze-control-component
```
-->
#### npm

Install via npm:

```bash
npm install aframe-gaze-control-component
```

Then require and use.

```js
require('aframe');
require('aframe-gaze-control-component');
```

### Example

A live example can be found [here](http://jacobsimonson.me:7000).

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