O'Reilly logo

Leap Motion Development Essentials by Mischa Spiegelmock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Window docking

Now that selection, translation, and scaling of windows is worked out, we can add support for our final supported gesture, flinging the window into a section of the screen to dock it. Imagine the user poking a window and then tossing it in whichever direction they choose with literally a flick of the wrist. Who wouldn't want to have the ability to dismissively toss around windows?

Implementing the gesture detection is straightforward enough; the Swipe gesture is triggered when the user draws a straight (-ish) line in the air, rapidly. In addition the gesture can be active while the user is still drawing the swipe, which allows us to provide a little bit of instant visual feedback.

Going back to our previous switch(gesture.type()) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required