scicalc: Add swipe up action

Swiping up has now the same effect as hitting the "<" button.
pull/3054/head
Erik Andresen 2023-10-18 18:37:15 +02:00
parent c8ef7097c0
commit 1500e68011
4 changed files with 10 additions and 4 deletions

View File

@ -1 +1,2 @@
0.01: New App!
0.02: Swiping up has now the same effect as hitting the "<" button.

View File

@ -5,7 +5,7 @@ by the JS interpreter.
## Usage
Buttons are arranged on 3 separate screens, swiping left or right switches between them. Swiping down has the same effect as hitting the "=" button.
Buttons are arranged on 3 separate screens, swiping left or right switches between them. Swiping down has the same effect as hitting the "=" button. Swiping up has the same effect as hitting the "<" button.
## Features

View File

@ -70,7 +70,7 @@ function compute() {
console.log(processInp(inputStr));
try { res = eval(processInp(inputStr)); }
catch(e) { res = "error"; }
inputStr = res;
inputStr = res === undefined ? '' : res;
qResult = true;
updateDisp(inputStr, 19);
}
@ -105,6 +105,11 @@ function swipeHandler(e,d) {
if (curPage<0) curPage = buttons.length-1;
drawPage(curPage);
if (d==1) compute();
else if (d==-1) {
if (inputStr.length>0) inputStr = inputStr.slice(0, -1); // delete last character
qResult = false;
updateDisp(inputStr, 32);
}
}
Bangle.on("touch", touchHandler);

View File

@ -1,7 +1,7 @@
{ "id": "scicalc",
"name": "Scientific Calculator",
"shortName":"SciCalc",
"version":"0.01",
"version":"0.02",
"description": "Scientific calculator",
"icon": "scicalc.png",
"screenshots" : [ { "url":"scicalc_screenshot1.png" }, { "url":"scicalc_screenshot2.png" }, { "url":"scicalc_screenshot3.png" } ],