Files
NapCatQQ/.pnpm-store/v3/files/5c/ac23448e6878f9a3099733e04eb71c5cf6903b03a56177875afdd518e44ba66bc922d5833bd8d940cc3e5b7d45ca90de6caeec2fa67622ef7a5a355efa5b7d
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

19 lines
616 B
Plaintext

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 };