Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snappybtn: new app. setWatch falling -> rising #3446

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
8 changes: 8 additions & 0 deletions apps/snappybtn/boot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
let _setWatch = setWatch;
global.setWatch = (fn,pin,opt) => {
let name = global.__FILE__ || "";
if (opt && opt.edge && opt.edge!="both" && !name.includes("run")) 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"}
]
}
Loading