This project is read-only.

Mouse Gesture Library

Mouse Gesture Library

Currently the mouse gesture library supports several gestures:
  • Shake
  • Glide
  • Hold

Quick cookbook

Gesture library is easy to use. There are three classes:
Shake
Glide
Hold

One can attach events on to the .OnSensed property of these objects:
Shake shake;
void Handle_Gesture(){
  shake = new Shake(this);
  shake.OnSensed += new EventHandler<MouseGestureEventArgBase>(Shake_Handler);
}
void Shake_Handler(object sender, MouseGestureEventArgBase event){
  //When you shake your mouse, this method is called
}

This is a key feature in the MouseGestureBase class and is extended by all other gestures. Similarly the same can be done with the Hold object:
Hold hold;
void Handle_Gesture(){
  hold = new Hold(this);
  hold.OnSensed += new EventHandler<MouseGestureEventArgBase>(Hold_Handler);
}
void Hold_Handler(object sender, MouseGestureEventArgBase event){
  //Do what you need to do when someone holds the cursor
}

The Glide object has a few more properties:
Glide glide;
glide = new Glide(this);
glide.OnSensed += // Your method that you call when there is a glide same as above examples
glide.Speed //The minimum speed of a glide
glide.Distance //The minimum distance of a glide
glide.Intensity //The intensity of a glide

Last edited Mar 20, 2012 at 11:34 AM by accurrent, version 3

Comments

LuoLiang Mar 20, 2012 at 3:35 PM 
Thx! You're great!