BangleApps/typescript
Rob Pilling 2bbef9f740 clkinfo: make `CLKINFO_FOCUS` a counter
This avoids issues when we have multiple clkinfos visible. The first clkinfo may want to focus itself, but a second clkinfo may then unfocus, deleting the first's effects (i.e. setting `CLKINFO_FOCUS`).

In detail:

`CLKINFO_FOCUS` will be set (to `true`) by the first handler (left hand clkinfo) and then unset (/ `delete`d) by the second handler (right hand clkinfo).

This is done in [the `touchHandler`](c2ea454a3b/apps/clock_info/lib.js (L313-L324)).

This commit makes `CLKINFO_FOCUS` a count.

- When we have a tap on a previous clkinfo (previous as in, earlier in the event handler list), it'll focus itself, `CLKINFO_FOCUS++`
- The later handler comes along, unfocuses itself, `CLKINFO_FOCUS--`
- `CLKINFO_FOCUS` is now `1`, so clkinfo is registered as being focussed still, meaning quicklaunch will work because of:

> c2ea454a3b/apps/quicklaunch/boot.js (L36-L36)

Fixes #3355
2024-04-18 18:12:58 +01:00
..
types clkinfo: make `CLKINFO_FOCUS` a counter 2024-04-18 18:12:58 +01:00
.gitignore move package back within typescript 2021-12-10 20:52:17 +01:00
README.md TypeScript: Refer to Espruino README 2022-07-27 17:41:59 +02:00
package-lock.json Typescript version updates 2023-02-14 22:32:57 +00:00
package.json typescript: add to authors 2023-02-19 17:58:22 +00:00

README.md

Bangle.ts

A generic project setup for compiling apps from Typescript to Bangle.js-ready, readable JavaScript.

The types are now automatically generated by a script (see here.

Compilation

Install npm and node.js if you haven't already. We recommend using a version manager like nvm, which is also referenced in the linked documentation. Make sure you are using node version 16 by running nvm use 16 and npm version ^8 by running npm -v. If the latter version is incorrect, run npm i -g npm@^8.

After having installed npm for your platform, open a terminal, and navigate into the /typescript folder. Then run:

npm ci

to install the project's build tools, and:

npm run build

To build all Typescript apps and widgets. The last command will generate the app.js files containing the transpiled code for the Bangle.js.