Input handling library for Zdog.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add support for capturing pointer events

When capture is set to true, all events after pointerdown will be sent to that event's element.

+8 -1
+8 -1
zfetch.js
··· 84 84 85 85 if (this.capture) { 86 86 this.startElement.setPointerCapture( event.pointerId ); 87 + this.startElement.addEventListener( 'lostpointercapture', this ); 87 88 } 88 89 89 90 this.downX = event.pageX; ··· 127 128 Zfetch.prototype.up = function( event ) { 128 129 if ( event.pointerId != this.downId ) return; 129 130 131 + if ( this.capture ) { 132 + this.startElement.releasePointerCapture( event.pointerId ); 133 + this.startElement.removeEventListener( 'lostpointercapture', this ); 134 + } 135 + 130 136 if (DEBUG) console.log("going uuuuup", event); 131 137 132 138 if ( this.moveX || this.moveY ) { ··· 143 149 Zfetch.prototype.onpointerdown = Zfetch.prototype.down; 144 150 Zfetch.prototype.onpointermove = Zfetch.prototype.move; 145 151 Zfetch.prototype.onpointerup = 146 - Zfetch.prototype.onpointercancel = Zfetch.prototype.up; 152 + Zfetch.prototype.onpointercancel = 153 + Zfetch.prototype.onlostpointercapture = Zfetch.prototype.up; 147 154 148 155 Zfetch.prototype.dispatchDragStart = function( event ) { 149 156 this.dragEvent = null;