FakeGazeDataProvider.js 528 Bytes
Newer Older
Alexander Bazo committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
import GazeDataProvider from "./GazeDataProvider.js";
import Event from "../utils/Event.js";
import GazePoint from "./GazePoint.js";

class FakeGazeDataProvider extends GazeDataProvider {

  constructor() {
    super();
  }

  start() {
    window.addEventListener("mousemove", this.onMouseDataAvailable.bind(this));
  }

  onMouseDataAvailable(event) {
    let gazeEvent = new Event("dataavailable", new GazePoint(event.screenX,
      event.screenY));
    this.notifyAll(gazeEvent);
  }

}

export default FakeGazeDataProvider;