stuyam / pressure

:point_down::boom: JavaScript library for handling Force Touch, 3D Touch, and Pointer Pressure.
https://pressurejs.com
MIT License
2.92k stars 97 forks source link

Support multiple `only` values / support `except` option #75

Open SteveEdson opened 6 years ago

SteveEdson commented 6 years ago

We have an issue with the pointer mode on some android devices (force is reported greater than 1, up to values such as 31 etc).

As a result, we want to disable this event and use the polyfill. However, we still want to support mouse and touch. Currently, there doesn't seem to be a way to do this, I'd like for one of the two options to be implemented if possible:

const config = {
    only: ['mouse', 'touch']
};

or

const config = {
    except: 'pointer'
};

Thanks.

stuyam commented 6 years ago

Sounds like this is part feature request, part bug report? I'm guessing the value going above 1 thing should be fixed too, I should have something to max out every outputted value to 1 if anything goes above.

I will also take a look at adding an array option or something for config. I am open to pull requests as well :smile: not sure when exactly I will get around to this but will keep you posted.