mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-23 12:56:46 +08:00
myTouchList[123] is allowed as an alias for myTouchList.item(123). https://developer.mozilla.org/en-US/docs/Web/API/TouchList and http://www.w3.org/TR/touch-events/#idl-def-TouchList
35 lines
629 B
TypeScript
35 lines
629 B
TypeScript
/// <reference path="touch-events.d.ts"/>
|
|
|
|
var touchEvent:TouchEvent;
|
|
var list:TouchList;
|
|
var touch:Touch;
|
|
|
|
list = touchEvent.touches;
|
|
list = touchEvent.targetTouches;
|
|
list = touchEvent.changedTouches;
|
|
|
|
var flag:boolean;
|
|
flag = touchEvent.altKey;
|
|
flag = touchEvent.metaKey;
|
|
flag = touchEvent.ctrlKey;
|
|
flag = touchEvent.shiftKey;
|
|
|
|
var len:number = list.length;
|
|
touch = list.item(0);
|
|
touch == list[0];
|
|
|
|
var x: number;
|
|
var y: number;
|
|
var id: number;
|
|
|
|
id = touch.identifier;
|
|
x = touch.screenX;
|
|
y = touch.screenY;
|
|
x = touch.clientX;
|
|
y = touch.clientY;
|
|
x = touch.pageX;
|
|
y = touch.pageY;
|
|
|
|
var target:EventTarget;
|
|
target = touch.target;
|