stuyam / pressure

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

Should a force / event be passed back to every function? #11

Closed stuyam closed 8 years ago

stuyam commented 8 years ago

for example:

start: function(force, event){

}

at the very least maybe the event should be passed back

stuyam commented 8 years ago

I think this only makes sense on certain ones, the force value will always be a set value on start, end, startDeepPress, and endDeepPress which I am not sure if that is useful or not. For example start and end will always be 0 and the deep press events will always be 0.5.

For events, I could pass back events on everything except the "end" method because there is no event to be handled there.

I still don't know if either of these are good ideas or useful.

stuyam commented 8 years ago

"force" is still only passed back on the "change" methods.

However the "event" of the click or touch is pass back into the "start", "startDeepPress", and "endDeepPress" functions.

Added in this commit: https://github.com/yamartino/pressure/commit/4beade1b2233293242f62d6e3f922f4098408aad