Blame view

天文台pc/tianwentai-ui/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.mjs 664 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  const isPrimaryPointer = (event) => {
      if (event.pointerType === "mouse") {
          return typeof event.button !== "number" || event.button <= 0;
      }
      else {
          /**
           * isPrimary is true for all mice buttons, whereas every touch point
           * is regarded as its own input. So subsequent concurrent touch points
           * will be false.
           *
           * Specifically match against false here as incomplete versions of
           * PointerEvents in very old browser might have it set as undefined.
           */
          return event.isPrimary !== false;
      }
  };
  
  export { isPrimaryPointer };
  //# sourceMappingURL=is-primary-pointer.mjs.map