change(tracker): tune shake check
This commit is contained in:
parent
018f618e12
commit
f5f7f37260
1 changed files with 2 additions and 2 deletions
|
|
@ -112,7 +112,7 @@ export default function (app: App): void {
|
|||
let directionChangeCount = 0
|
||||
let distance = 0
|
||||
let checkIntervalId: NodeJS.Timer
|
||||
const shakeThreshold = 0.005
|
||||
const shakeThreshold = 0.008
|
||||
const shakeCheckInterval = 225
|
||||
|
||||
function checkMouseShaking() {
|
||||
|
|
@ -124,7 +124,7 @@ export default function (app: App): void {
|
|||
}
|
||||
|
||||
const acceleration = (nextVelocity - velocity) / shakeCheckInterval
|
||||
if (directionChangeCount && acceleration > shakeThreshold) {
|
||||
if (directionChangeCount > 3 && acceleration > shakeThreshold) {
|
||||
console.log('Mouse shake detected!')
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue