Your skill will accomplish
what the force of many cannot
Detecting swipe movementsby morgon (Curate)
|on May 16, 2014 at 12:20 UTC||Need Help??|
morgon has asked for the
wisdom of the Perl Monks concerning the following question:
sorry for the following rather vague description but I am just starting to think about it, so I have not yet explored any options.
The background of what I want to do is to use a wireless presenter (a Genius RingPresenter to be precise) that also can transmit mouse-events to remote-control a raspberry pi.
I do not want to use it as a mouse-replacement (the pi runs headless) but I rather want mouse-movements to be translated into actions, e.g. when I swipe upwards I want the volume of mpd to be increased or something along those lines.
For that what I do is to read mouse-events from a /dev/input/event* device and what I get are events that basically give me a timestamp, an axis (either up-down or left-right) and a some relative movement.
What I now would like to do is detect swipe-movements (ie. "swipe-up", "swipe-down", "swipe-left", "swipe-right") from an array of such events.
Now an up-swipe will probably be defined as some motion that "mainly" goes upwards in a certain amount of time.
Evidently when performing an up-swipe there will also be some events of small movements to the right or left and maybe even a small amount of downward movement so I need some sort of "fuzzyness" in my detection.
Can someone point me to some modules that may be of use for such a task?