How to use gaze

Comprehensive gaze code examples:

How to use gaze.status:

20
21
22
23
24
25
26
27
28
29
  } else if(status.unknown) {
    // don't know what to say
  }
});
var check = function() {
  gaze.status(function(status) {
    console.log("last event at", status.moved_at);
    if(status.entered) {
      if(status.latest_point) {
        console.log("gaze event at", point.x, point.y, point.timestamp);

How to use gaze.listen:

10
11
12
13
14
15
16
17
18
19
var gaze = require('gaze');

gaze.setup(function(status) {
  if(status.can_track_eyes && status.ready) {
    // ready!
    gaze.listen();
  } else if(status.calibration_needed || status.screen_setup_needed) {
    // calibraiton needed
  } else if(status.configuring) {
    // calibration in progress

How to use gaze.stop_listening:

38
39
40
41
42
43
44
45
setInterval(function() {
  count++;
  if(count < 10) {
    check();
  } else {
    gaze.stop_listening();
  }
}, 500);

How to use gaze.Gaze:

96
97
98
99
100
101
102
103
104
105
* `options` {Object}
* `callback` {Function}
  * `err` {Error | null}
  * `watcher` {Object} Instance of the Gaze watcher

### Class: gaze.Gaze

Create a Gaze object by instancing the `gaze.Gaze` class.

```javascript