Skip to content

This module solves the problem of longtime events from a trackpad or a magic mouse.

License

Notifications You must be signed in to change notification settings

hellopath/wheel-inertia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wheel Inertia

This module solves the problem of longtime events from a trackpad or a magic mouse

The base of the code coming from a comment of @msimpson (https://github.com/msimpson)

See comments for more details.

Check an example here

Usage

import inertia from 'wheel-inertia'

// Add your callback
inertia.addCallback(myCallback)

function myCallback(direction) {
	// do something with your wheel event
	// you can also get the direction of wheel
}

// Update the module with your wheel delta, so from inside your 'wheel' listener...
var delta = e.wheelDelta
inertia.update(delta)

Install

With npm do:

npm install wheel-inertia

License

MIT

About

This module solves the problem of longtime events from a trackpad or a magic mouse.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published