Skip to content

Commit

Permalink
snappybtn: new app. setWatch falling -> rising
Browse files Browse the repository at this point in the history
Came out of this discussion: espruino#3435
  • Loading branch information
thyttan committed Jun 30, 2024
1 parent 7b991ea commit 23edc19
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/snappybtn/ChangeLog
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.01: New App!
32 changes: 32 additions & 0 deletions apps/snappybtn/README.md
Original file line number Diff line number Diff line change
@@ -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
Binary file added apps/snappybtn/app.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions apps/snappybtn/boot.js
Original file line number Diff line number Diff line change
@@ -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);
};
}
13 changes: 13 additions & 0 deletions apps/snappybtn/metadata.json
Original file line number Diff line number Diff line change
@@ -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"}
]
}

0 comments on commit 23edc19

Please sign in to comment.