An open API service indexing awesome lists of open source software.

https://github.com/obsius/mousetouch

A small library to provide consistent mouse and touch interactions.
https://github.com/obsius/mousetouch

Last synced: about 1 year ago
JSON representation

A small library to provide consistent mouse and touch interactions.

Awesome Lists containing this project

README

          

# 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:
```js
{
x: '',
y: '',
event: ''
}
```

```js
import Mousetouch from 'mousetouch';
const Mousetouch = require('mousetouch');

const mousetouch = new Mousetouch('', {
clickThreshold: '',
dblClickThreshold: '',
moveThreshold: ''
});

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](https://opensource.org/licenses/MIT) license.