Friday, June 5th, 2009
Moousture: mouse gesture library

Zohaib Sibt-e-Hassan has created a Mootools based mouse gesture library Moousture that is based on simplicity:
- A probe, which probes the pointing device. Currently there
is a Moousture.MouseProbe (P.S. I am planning to test it on iPhone and
build any seprate probe for that). - A monitor, which tests the stability of probed
device on given intervals and accordingly notifies Moousture events
(onStable, onUnstable, onMove). - A Moousture recorder class that records the mouse
movements and invoke the guesture object passed to it.
You can easily work with gestures:
JAVASCRIPT:
-
-
// Create a guesture matcher, currently there are only two gesture objects Moousture.LevenMatcher, and Moousture.ReducedLevenMatcher.
-
-
gstr = new Moousture.ReducedLevenMatcher();
-
-
// Add gesture vectors to matcher object, (see details below in Create your own gestures).
-
-
gstr.addGesture([3,2,1,0,7,6,5,4], ccwCircle);
-
-
// Guesture callback function takes one parameter error recieved from matching algorithm. Threshold that value (if required) to make your gestures more sleek.
-
-
function ccwCircle(error) {
-
if(error>= 0.6) return;
-
...
-
}
-
-
// Create a probe object that will probe the pointing device. Currently there is a mouse probe that take the $(element) to probe for. So passing a div id will cause the probe to trigger events only when they occur on the passed DOM element.
-
probe = new Moousture.MouseProbe($(document));
-
-
// Create a recoder object to record the movement , maxSteps and minSteps in options object will specify the maximum and minimum number of steps to be recorded, and macher is required matcher object to trigger the appropriate gesture.
-
recorder = new Moousture.Recorder({maxSteps: 20, minSteps: 8, matcher: gstr});
-
-
// Create a monitor specifying the interval to poll and the amount of error allowed for gesture in pixels.
-
monitor = new Moousture.Monitor(30, 2);
-
-
// Finally start the monitor.
-
monitor.start(probe, recorder);
-
-
// You can stop the gesture triggering any time by calling .stop() of monitor object.
-
monitor.stop();
-





4 rating from 25 votes







Interesting stuff, but why not call it Mousture? Doesn’t have the connotation of a cow or mootools.
@thnkfstr – It uses mootools.
Fabulous work!
That is really well done, with a simple way of creating gestures.
It took me a bit to figure it out, because I kept circling the cursor but never saw the menu appear (until I stopped the gesture). I was waiting for some sort of indication that I was gestured correctly.
Great work!
Aww server down, I was looking forward to trying it out and digging through the source.
Not bad, but I find mouse gestures intrusive.
Being able to create them on demand is as bad as being able to resize the browser window and remove toolbars. :/
@dark – on the other hand, maybe we can remove that tab button so users won’t be able to tab outside the window… :P
On the third hand gestures can be quite handy for touchscreen mobile browsers.
It requires more experiments to define a good gesture. I have built a library to track user clicking positions instead of mouse movements, so I understand it is hard to determine “the end” of a gesture. That is, the next gesture usually mess up with previous one. However I found that the library gives bad results for short gestures. Or may be I have used bad tuning parameters?
I would suggest to add a parameter to clear recorded gestures after certain period of time.
Cool!
Shouldn’t be that hard to port this to jQuery.
Wow gold Wow gold buy wow gold buy wow gold cheap wow gold cheap wow gold cheapest wow gold cheapest wow gold buying wow gold buying wow gold sell wow gold sell wow gold wow gold for sale wow gold for sale wow gold sale wow gold sale wow buy gold
wow power leveling wow power leveling world of warcraf power leveling world of warcraf power leveling wow leveling wow leveling wow gold us wow gold us wow gold eu wow gold eu world of warcraft us world of warcraft us world of warcraft eu world of warcraft eu world of warcraft eu
wow co key wow co key wow co key wow buy gold wow cheap gold wow cheap gold wow gold for sale wow gold for sale world of warcraft gold world of warcraft gold wow accounts wow accounts wow power leveling wow power leveling world of warcraf power leveling
wow leveling world of warcraf power leveling wow leveling wow leveling wow co key wow co key wow accounts wow accounts cheap wow power leveling cheap wow power leveling buy wow power leveling buy wow power leveling buy wow power leveling
Don’t use the products which can make the skin slippery, that is to say the foundation should be sun-resistant. If you use the sunscreen lotion under the foundation, it will definitely lead to the foudation movement. Point 2, using lambency or ultra-lambency foundation make-up, even if for dry skin, this kind of foundation make-up links of london is of better ability in staying where it was, and it is less likely to be affected by sebum secretion so as to move into pores. sweetie braceletPoint 3: if the pore holes are really serious, making up several times during the day is bracelet charms indispensable. When making up use oil-absorbing tissue as an adjustment, and then add dual-use powder as base makeup. The dual-use powder must be thicker than usual one to hide the coarse pores.
The Windows 7 key is a usually unique, alphanumeric code of any length required by many software programs during installation. Unique windows 7 product key help software manufacturers ensure that each copy of their software was legally purchased. Windows 7 Home key | Windows 7 Professional key | Windows 7 Ultimate key | Windows 7 Enterprise key | Windows 7 Home Premium key
The unique Windows 7 serial key entered for an operating system or a software program is typically stored in an encrypted format in the Windows Registry, making finding one very difficult without some help. The above linked guides should help find just about any Windows 7 CD key you may be looking for.Windows 7 Home product key | Windows 7 Professiona productl key | Windows 7 Ultimate product key
This Windows 7 product serial number, if it exists, is the generic Windows 7 Home product key that Microsoft allowed your PC builder to use when mass producing computers. In other words, everyone’s disc has the same product key. Your unique key for use when reinstalling Windows will be the one on the sticker on your computer. Windows 7 Enterprise key | Windows 7 Home Premium key
The xbox live points is the second video game console produced by Microsoft, and the successor to the Xbox. The xbox 360 live points competes with Sony’s xbox 360 live 1600 points and Nintendo’s Wii as part of the seventh generation of video game consoles.xbox live points card xbox 360 live points card
Some major features of the Xbox 360 are its integrated xbox 360 live 2000 points that allows players to compete online, download arcade games, game demos, trailers, TV shows and movies and its Windows Media Center multimedia capabilities. The xbox live 2000 points also offers region specific access to third-party media streaming services such as Netfilx in the USA or Sky TV and xbox 360 live 4000 points in the UK.
The xbox live 1600 points was officially unveiled on MTV on May 12, 2005, with detailed launch and game information divulged later that month at the Electronic Entertainment Expo (E3). The xbox live 4000 points sold out completely upon release in all regions except in Japan and, as of October 2009, nearly 34 million units have been sold worldwide. The xbox 360 live 3000 points is currently available in two configuraions—the “Arcade” and the “Elite”—and each has its own selection of accessories.