Skip to content

Piu Application overrides Button class back #13

Description

@vincentezw

It's possible this is intentional, or can be overwritten by defining a custom Behavior but I did not see that documented to wanted to flag this.

When instantiating an instance of Piu's Application class, this captures the back button and seemingly overrides custom behaviour I'm trying to add using the Button class. Here is the simplest form of replicating this, using the hellubutton example code to capture button presses:

import {} from "piu/MC";
import Button from "pebble/button"

console.log("hello, button - press a button");
console.log("  press and hold back to exit");

new Button({
	types: ["select", "up", "down", "back"],
	onPush(down, type) {
		console.log(`${down ? "press" : "release"} ${type}`);
	}
});

export default new Application();

My application renders a menu and it would feel intuitive to allow the user to "back" out of it, but in the current form a press of the back button closes the application completely.

I'm aware the button mechanism received some attention as part of #12 so this may be relevant here as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions