Detecting a mouse shake?
Posted: Thu Oct 29, 2015 8:57 pm
Trying to work out a way to detect when the mouse is being shaken. i.e. moved back and forth rapidly in a relatively small space. I thought I had figured it out but not quite.
I was using all three mouse callbacks. Pressed, Moved and Released to store the information. And was basing my detection on how far the mouse has moved compared to how much total distance it has traveled and while it worked, it also sends false positives if the shake timer reaches the end when you happen to be moving the mouse in the area of its initial press.
I'm probably missing a pretty simple solution involving maths or something.
I was using all three mouse callbacks. Pressed, Moved and Released to store the information. And was basing my detection on how far the mouse has moved compared to how much total distance it has traveled and while it worked, it also sends false positives if the shake timer reaches the end when you happen to be moving the mouse in the area of its initial press.
I'm probably missing a pretty simple solution involving maths or something.