1. @any-touch/press
any-touch的识别器, 用来识别按压手势.
@any-touch/press
Package: @any-touch/press
Last modified: Tue, 24 May 2022 06:44:02 GMT
Version: 2.2.0
License: MIT
Downloads: 888

Install

npm install @any-touch/press
yarn add @any-touch/press

@any-touch/press

按压识别器.

安装

 npm i -S @any-touch/press

快速开始

 // 只加载press识别器(按压)
import Core from '@any-touch/core';
import press from '@any-touch/press';
const at = new Core(el);
at.use(press, 参数)

// 按压
at.on('press', (event) => {
    // event包含位置/速度/方向等信息
});

参数

名称 数据类型 默认值 说明
name String 'press' 自定义事件名称
pointLength Number 1 支持的触点数, 可支持多指按压
maxDistance Number 9 触点允许移动的最大距离
minPressTime Number 251 触发事件需要按压的最小时间

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code