diff --git a/testing/binary-keyboard.js b/testing/binary-keyboard.js new file mode 100644 index 000000000..3b68179a4 --- /dev/null +++ b/testing/binary-keyboard.js @@ -0,0 +1,50 @@ +/* +Binary search keyboard for typing with +the touchscreen +*/ + +function showChars(x,chars) { + var lines = Math.round(Math.sqrt(chars.length)*2); + g.setFontAlign(0,0); + var sy = Math.round(200/lines); + var sx = sy; + g.setFont("Vector", sy-2); + var y = (240 - lines*sy); + var last = 0; + for (var i=0;i { + clearWatch(); + show(charl,callback); + }, BTN4); + setWatch(() => { + clearWatch(); + show(charr,callback); + }, BTN5); +} + +function getCharacter() { + return new Promise(resolve => { + show("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",resolve); + }); +} + +getCharacter().then(print) \ No newline at end of file