Created
March 3, 2014 22:24
-
-
Save connerbrooks/9335935 to your computer and use it in GitHub Desktop.
[wearscript]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html style="width:100%; height:100%; overflow:hidden"> | |
<body style="width:100%; height:100%; overflow:hidden; margin:0"> | |
<script> | |
function main() { | |
if (WS.scriptVersion(1)) return; | |
WS.pebbleSetBody('connected!', false); | |
WS.gestureCallback('onPebbleSingleClick', function (name) { | |
WS.log('onPebbleSingleClick: ' + name); | |
switch (name) { | |
case 'up': | |
WS.control('SWIPE_LEFT'); | |
break; | |
case 'down': | |
WS.control('SWIPE_RIGHT'); | |
break; | |
case 'select': | |
WS.control('TAP'); | |
break; | |
} | |
}); | |
WS.gestureCallback('onPebbleLongClick', function (name) { | |
WS.log('onPebbleLongClick: ' + name); | |
if(name === 'select') | |
WS.control('SWIPE_DOWN'); | |
}); | |
WS.gestureCallback('onPebbleAccelTap', function (axis, direction) { | |
WS.log('onPebbleAccelTap: ' + axis + ' ' + direction); | |
}); | |
} | |
window.onload = main; | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment