mirror of https://github.com/espruino/BangleApps
Fix ‘kbmorse’
parent
aee02b93e3
commit
9c05a142c0
|
@ -1 +1,2 @@
|
||||||
0.01: New Keyboard!
|
0.01: New Keyboard!
|
||||||
|
0.02: Temporarily fix because of firmware bug.
|
||||||
|
|
|
@ -82,6 +82,36 @@ exports.input = function(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
const Layout = require("Layout");
|
||||||
|
let layout = new Layout({
|
||||||
|
type: "h", c: [
|
||||||
|
{
|
||||||
|
type: "v", width: Bangle.appRect.w-8, bgCol: g.theme.bg, c: [
|
||||||
|
{id: "dots", type: "txt", font: "6x8:2", label: "", fillx: 1, bgCol: g.theme.bg},
|
||||||
|
{filly: 1, bgCol: g.theme.bg},
|
||||||
|
{
|
||||||
|
type: "h", fillx: 1, c: [
|
||||||
|
{id: "del", type: "txt", font: "6x8", label: "<X"},
|
||||||
|
{width: 5, bgCol: g.theme.bg},
|
||||||
|
{id: "text", type: "txt", font: "6x8:2", col: g.theme.fg2, bgCol: g.theme.bg2},
|
||||||
|
{fillx: 1, bgCol: g.theme.bg},
|
||||||
|
{id: "code", type: "txt", font: "6x8", label: "", bgCol: g.theme.bg},
|
||||||
|
{width: 5, bgCol: g.theme.bg},
|
||||||
|
{id: "pick", type: "txt", font: "6x8:3", label: "", col: g.theme.fgH, bgCol: g.theme.bgH},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{filly: 1, bgCol: g.theme.bg},
|
||||||
|
{id: "dashes", type: "txt", font: "6x8:2", label: "", fillx: 1, bgCol: g.theme.bg},
|
||||||
|
]
|
||||||
|
},
|
||||||
|
// button labels (rotated 90 degrees)
|
||||||
|
{
|
||||||
|
type: "v", pad: 1, filly: 1, c: ["<.", "^", "|"].map(l =>
|
||||||
|
({type: "txt", font: "6x8", height: Math.floor(Bangle.appRect.h/3), r: 1, label: l})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
function update() {
|
function update() {
|
||||||
let dots = [], dashes = [];
|
let dots = [], dashes = [];
|
||||||
|
@ -157,36 +187,6 @@ exports.input = function(options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Layout = require("Layout");
|
|
||||||
let layout = new Layout({
|
|
||||||
type: "h", c: [
|
|
||||||
{
|
|
||||||
type: "v", width: Bangle.appRect.w-8, bgCol: g.theme.bg, c: [
|
|
||||||
{id: "dots", type: "txt", font: "6x8:2", label: "", fillx: 1, bgCol: g.theme.bg},
|
|
||||||
{filly: 1, bgCol: g.theme.bg},
|
|
||||||
{
|
|
||||||
type: "h", fillx: 1, c: [
|
|
||||||
{id: "del", type: "txt", font: "6x8", label: "<X"},
|
|
||||||
{width: 5, bgCol: g.theme.bg},
|
|
||||||
{id: "text", type: "txt", font: "6x8:2", col: g.theme.fg2, bgCol: g.theme.bg2},
|
|
||||||
{fillx: 1, bgCol: g.theme.bg},
|
|
||||||
{id: "code", type: "txt", font: "6x8", label: "", bgCol: g.theme.bg},
|
|
||||||
{width: 5, bgCol: g.theme.bg},
|
|
||||||
{id: "pick", type: "txt", font: "6x8:3", label: "", col: g.theme.fgH, bgCol: g.theme.bgH},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{filly: 1, bgCol: g.theme.bg},
|
|
||||||
{id: "dashes", type: "txt", font: "6x8:2", label: "", fillx: 1, bgCol: g.theme.bg},
|
|
||||||
]
|
|
||||||
},
|
|
||||||
// button labels (rotated 90 degrees)
|
|
||||||
{
|
|
||||||
type: "v", pad: 1, filly: 1, c: ["<.", "^", "|"].map(l =>
|
|
||||||
({type: "txt", font: "6x8", height: Math.floor(Bangle.appRect.h/3), r: 1, label: l})
|
|
||||||
)
|
|
||||||
}
|
|
||||||
]
|
|
||||||
});
|
|
||||||
g.reset().clear();
|
g.reset().clear();
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
@ -244,4 +244,4 @@ exports.input = function(options) {
|
||||||
};
|
};
|
||||||
Bangle.on("swipe", Bangle.swipeHandler);
|
Bangle.on("swipe", Bangle.swipeHandler);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "kbmorse",
|
"id": "kbmorse",
|
||||||
"name": "Morse keyboard",
|
"name": "Morse keyboard",
|
||||||
"version": "0.01",
|
"version": "0.02",
|
||||||
"description": "A library for text input as morse code",
|
"description": "A library for text input as morse code",
|
||||||
"icon": "app.png",
|
"icon": "app.png",
|
||||||
"type": "textinput",
|
"type": "textinput",
|
||||||
|
|
Loading…
Reference in New Issue