diff --git a/apps/snappybtn/ChangeLog b/apps/snappybtn/ChangeLog new file mode 100644 index 00000000000..5560f00bce7 --- /dev/null +++ b/apps/snappybtn/ChangeLog @@ -0,0 +1 @@ +0.01: New App! diff --git a/apps/snappybtn/README.md b/apps/snappybtn/README.md new file mode 100644 index 00000000000..9b98dc8921e --- /dev/null +++ b/apps/snappybtn/README.md @@ -0,0 +1,32 @@ +# Snappy Button (BETA) + +Make your Bangle.js 2 watch react quicker when you press the hardware button. + +## Usage + +Just install it from the app loader to enable the behaviour on your watch. + +## Features + +The Bangle.js 2 often reacts at first when the hardware button is released. **Snappy Button** changes this so it reacts as soon as the button is pressed down. + +When installed the app highjacks the `setWatch` function and changes the `edge` option from `"falling"` to `"rising"`. + +Snappy button can be incompatible with some apps **(breaking them!)** that uses long presses of the hardware button. This is worked around by hardcoding Snappy Button to not interfere with these apps. **Please if you encounter problems report them as per below!** + +## TODO + +- Disable for more incompatible apps as they are found. +- Enable for Bangle.js 1? **Help with testing needed!** + +## Requests + +Mention @thyttan in an issue on the espruino/BangleApps repository if you encounter problems or have an idea for improving Snappy Button. + +Pull requests always welcome! + +This app was proposed on the espruino/BangleApps repository: [Discussion: HW buttons should act on 'rising' edge](https://github.com/espruino/BangleApps/issues/3435) . + +## Creator + +gfwilliams, thyttan diff --git a/apps/snappybtn/app.png b/apps/snappybtn/app.png new file mode 100644 index 00000000000..d3e58ea9e97 Binary files /dev/null and b/apps/snappybtn/app.png differ diff --git a/apps/snappybtn/boot.js b/apps/snappybtn/boot.js new file mode 100644 index 00000000000..3c9a6e14397 --- /dev/null +++ b/apps/snappybtn/boot.js @@ -0,0 +1,7 @@ +{ + let _setWatch = setWatch; + global.setWatch = (fn,pin,opt) => { + if (opt && opt.edge && opt.edge!="both" && global.__FILE__!="runplus.app.js") opt.edge = "rising"; + return _setWatch(fn, pin, opt); + }; +} diff --git a/apps/snappybtn/metadata.json b/apps/snappybtn/metadata.json new file mode 100644 index 00000000000..470bb900d2c --- /dev/null +++ b/apps/snappybtn/metadata.json @@ -0,0 +1,13 @@ +{ "id": "snappybtn", + "name": "Snappy Button (BETA)", + "version":"0.01", + "description": "Make your Bangle.js 2 watch react quicker when you press the hardware button. This is an **experimental or BETA** app.", + "icon": "app.png", + "tags": "ui,interface,ux,faster,quicker,shorter,speed", + "type": "bootloader", + "supports" : ["BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"snappybtn.boot.js","url":"boot.js"} + ] +}