From aa595f6e24ba5dc8388a1893ae575f6aee433987 Mon Sep 17 00:00:00 2001 From: thyttan <6uuxstm66@mozmail.comā©> Date: Sat, 8 Jun 2024 12:09:45 +0200 Subject: [PATCH] snappybtn: new app. setWatch falling -> rising Came out of this discussion: https://github.com/espruino/BangleApps/issues/3435 --- apps/snappybtn/ChangeLog | 1 + apps/snappybtn/README.md | 32 ++++++++++++++++++++++++++++++++ apps/snappybtn/app.png | Bin 0 -> 1500 bytes apps/snappybtn/boot.js | 7 +++++++ apps/snappybtn/metadata.json | 13 +++++++++++++ 5 files changed, 53 insertions(+) create mode 100644 apps/snappybtn/ChangeLog create mode 100644 apps/snappybtn/README.md create mode 100644 apps/snappybtn/app.png create mode 100644 apps/snappybtn/boot.js create mode 100644 apps/snappybtn/metadata.json 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 0000000000000000000000000000000000000000..d3e58ea9e97b132c3f9e509bcabb01bd59d2ca59 GIT binary patch literal 1500 zcmV<21ta>2P)#wRZdSUW9TrQPjK$b$JmQ^di)* ziDHFU6qlZoq(=oS8qdpnKtt#=4WZi_Lfn^oH0Z9A{6k7VxC|X(-7JT;#;z_ z4WT2&5BHl}xALZW^Ej-pL+Bl|wF`AgNpFFea|;*p+atvH6@AUSw{PHmMcYO}_|wuL zrEbv)7a8LhcYG3A z+q!I-0ifAzFPZ}26~)&#}joBPFK1jWKNt!HJ#p)1B)e!2dS?!1k@Jo&ayYHns zNt!BH&FUp-a`k$AAr?T*rw(_G&Gw{VRbv#pVgaa>J0?O9HqlKBCGb0M|jsHyFh;-LfNCA(*WvzoEtUXfBBmr znBwHO+IB|G`3`0UR7&nJN(PwX3>^C*L-&*>>!IkZF$Lgs#rvb?Doc}j?VdTK#xHqS zbC2TW5ScLCU`Gi*abPi|;E=n-@oK^V20AGJ^JE_HY2G$!?u!3&-r2Ni)cExa1;#!7 zZN*XJH^Wh*WJAIL#@Ba;3xMmM#JQ~N^UWQ^sAJ3JT7b>zQ!Ztvl9{Bu=~JOr+f|Gdbk z=_vD z5rDTpE{MbdxZ(m(DP9FPz}6q@q53cgO931%Cyz5q+Nw%Zbl6<}55jja%US?n6*7K> zQPLeRgyjIh+%CsUjFQgE(iFY7Ie)@M^6>_+5(K+n0INW-u>gRniZnIecfvAl?_^Tz zIyLyP`uz*^-t%LtPy_9hH>w|m`b17m-JO7cSMa%}O@iKy@%&BYkD0C86#Ew*%x4OwW<2Tu0000 { + 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..1a2cf3dc257 --- /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/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"} + ] +}