Merge pull request #192 from brainfart-be/master

Enhancement: Add better touch and swipe support to Toucher
pull/198/head
Gordon Williams 2020-04-03 08:08:50 +01:00 committed by GitHub
commit 01959b7ff6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 5 deletions

View File

@ -999,7 +999,7 @@
"name": "Touch Launcher",
"shortName":"Menu",
"icon": "app.png",
"version":"0.01",
"version":"0.02",
"description": "Touch enable left to right launcher.",
"tags": "tool,system,launcher",
"type":"launch",

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Add swipe support and doucle tap to run application

View File

@ -103,10 +103,28 @@ function drawMenu(){
}
drawMenu();
// Physical buttons
setWatch(prev, BTN1, {repeat:true});
setWatch(prev, BTN4, {repeat:true});
setWatch(next, BTN3, {repeat:true});
setWatch(next, BTN5, {repeat:true});
setWatch(run, BTN2, {repeat:true,edge:"falling"});
// Screen event
Bangle.on('touch', function(button){
switch(button){
case 1:
prev();
break;
case 2:
next();
break;
case 3:
run();
break;
}
});
Bangle.on('swipe', dir => {
if(dir == 1) prev();
else next();
});