draguboard: Compat w backswipe on newer firmwares
parent
4061bd2f5e
commit
92e2f4695c
|
|
@ -1 +1,3 @@
|
|||
0.01: New App based on dragboard, but with a U shaped drag area
|
||||
0.02: Catch and discard swipe events on fw2v19 and up (as well as some cutting
|
||||
edge 2v18 ones), allowing compatability with the Back Swipe app.
|
||||
|
|
|
|||
|
|
@ -104,16 +104,7 @@ exports.input = function(options) {
|
|||
}
|
||||
}
|
||||
|
||||
return new Promise((resolve,reject) => {
|
||||
// Interpret touch input
|
||||
Bangle.setUI({
|
||||
mode: 'custom',
|
||||
back: ()=>{
|
||||
Bangle.setUI();
|
||||
g.clearRect(Bangle.appRect);
|
||||
resolve(text);
|
||||
},
|
||||
drag: function(event) {
|
||||
let dragHandlerUB = function(event) {
|
||||
"ram";
|
||||
|
||||
// drag on middle bottom rectangle
|
||||
|
|
@ -141,8 +132,25 @@ exports.input = function(options) {
|
|||
prevChar = null;
|
||||
updateTopString();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
let catchSwipe = (_,__)=>{
|
||||
E.stopEventPropagation&&E.stopEventPropagation();
|
||||
};
|
||||
|
||||
return new Promise((resolve,reject) => {
|
||||
// Interpret touch input
|
||||
Bangle.setUI({
|
||||
mode: 'custom',
|
||||
back: ()=>{
|
||||
Bangle.setUI();
|
||||
Bangle.prependListener&&Bangle.removeListener('swipe', catchSwipe); // Remove swipe lister if it was added with `Bangle.prependListener()` (fw2v19 and up).
|
||||
g.clearRect(Bangle.appRect);
|
||||
resolve(text);
|
||||
},
|
||||
drag: dragHandlerDB
|
||||
});
|
||||
Bangle.prependListener&&Bangle.prependListener('swipe', catchSwipe); // Intercept swipes on fw2v19 and later. Should not break on older firmwares.
|
||||
|
||||
R = Bangle.appRect;
|
||||
MIDPADDING = R.x + 35;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ "id": "draguboard",
|
||||
"name": "DragUboard",
|
||||
"version":"0.01",
|
||||
"version":"0.02",
|
||||
"description": "A library for text input via swiping U-shaped keyboard.",
|
||||
"icon": "app.png",
|
||||
"type":"textinput",
|
||||
|
|
|
|||
Loading…
Reference in New Issue