Skip to content

Instantly share code, notes, and snippets.

@connerbrooks
Created March 3, 2014 22:24
Show Gist options
  • Save connerbrooks/9335935 to your computer and use it in GitHub Desktop.
Save connerbrooks/9335935 to your computer and use it in GitHub Desktop.
[wearscript]
<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