2.0.1 • Published 1 year ago

mousetouch v2.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
1 year ago

Mousetouch

Mousetouch is a small, lightweight library to provide consistent mouse and touch interactions. It only support touch interactions that can be done with the mouse also.

Integrating

Mousetouch has defined defaults and can be used by constructing it.

Reference

Events fired are of the format:

{
	x: '<number>',
	y: '<number>',
	event: '<original event>'
}
import Mousetouch from 'mousetouch';
const Mousetouch = require('mousetouch');

const mousetouch = new Mousetouch('<dom element to listen to>', {
	clickThreshold: '<default 200 ms>',
	dblClickThreshold: '<default 500ms>',
	moveThreshold: '<default 2px>'
});

mousetouch.on('mousemove', (e) => { console.log(e) }); // { x, y, event }
mousetouch.on('mousedown', (e) => {});
mousetouch.on('mouseup', (e) => {});
mousetouch.on('click', (e) => {});
mousetouch.on('dblclick', (e) => {});

Contributing

Feel free to make changes and submit pull requests whenever.

License

Mousetouch uses the MIT license.

2.0.1

1 year ago

2.0.0

1 year ago

1.2.7

2 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago