コード例 #1
0
ファイル: Key.js プロジェクト: acheetham/scenery
 scenery.Key = function Key( event ) {
   Pointer.call( this );
   
   this.event = event; // event.keyCode event.charCode
   this.isKey = true; // compared to isMouse/isPen/isTouch
   this.trail = null;
   this.type = 'key';
 };
コード例 #2
0
ファイル: Pen.js プロジェクト: acheetham/scenery
 scenery.Pen = function Pen( id, point, event ) {
   Pointer.call( this );
   
   this.id = id;
   this.point = point;
   this.isPen = true;
   this.trail = null;
   
   this.isDown = true; // pens always start down? TODO: is this true with pointer events?
   
   this.type = 'pen';
 };
コード例 #3
0
ファイル: Mouse.js プロジェクト: phetsims/scenery
  /**
   * @extends Pointer
   * @constructor
   */
  function Mouse() {
    Pointer.call( this, null, false, 'mouse' );

    // @deprecated, see https://github.com/phetsims/scenery/issues/803
    this.leftDown = false;
    this.middleDown = false;
    this.rightDown = false;

    // mouse wheel delta and mode for the last event, see https://developer.mozilla.org/en-US/docs/Web/Events/wheel
    this.wheelDelta = new Vector3( 0, 0, 0 );
    this.wheelDeltaMode = 0; // 0: pixels, 1: lines, 2: pages

    sceneryLog && sceneryLog.Pointer && sceneryLog.Pointer( 'Created ' + this.toString() );
  }
コード例 #4
0
ファイル: Mouse.js プロジェクト: acheetham/scenery
 scenery.Mouse = function Mouse() {
   Pointer.call( this );
   
   this.point = null;
   
   this.leftDown = false;
   this.middleDown = false;
   this.rightDown = false;
   
   this.isMouse = true;
   
   this.trail = null;
   
   this.isDown = false;
   
   // overrides the cursor of whatever is under it when set
   this._cursor = null;
   
   this.type = 'mouse';
 };