Swipe on Gear 2

Swipe on Gear 2

BY 08 Jun 2014 Web Application Development

I want to detect swipes on Gear 2. I’ve tried several things:

My own code based on onMouseMove event, works in browser, but on device it only fires on a fresh press and not a move.

This code, again works on browser:

    <link rel=”stylesheet” href=”http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css”>
     <script src=”http://code.jquery.com/jquery-1.10.2.min.js”></script>
     <script src=”http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js”></script>

    $(‘#canvas’).bind(‘swipeleft’,function(){
        Game.title.textContent = “swipeleft”;
    });

    $(‘#canvas’).bind(‘swiperight’,function(){
        Game.title.textContent = “swiperight”;
    });

This complains: js/main.js (70) :ReferenceError: Can’t find variable: $

What do I need to do to enable JQuery or can that be translated to reqular javascript?

Also, why does onMouseMove not work?

 

Written by