Skip to content

feat: events #16

@gselzer

Description

@gselzer

For scenex to be usable in an application like pyapp-kit/ndv, we require the ability to modify model parameters based on user interactions (minimually the mouse buttons & scroll wheel). Ideally, this would be as simple as the scenex user saying "when the mouse does X (around my node Y), run my function Z", e.g.:

  • When the mouse hovers over an Image node, we display (somewhere) the value under the mouse.
  • When the mouse is pressed and then dragged, we translate the Camera node, unless the mouse is above another Node object - in that case we translate the object.

To provide an extensible mechanism enabling this behavior, we require an event abstraction that users can listen to. The questions, then, are?

  • How are these events generated?
    • Do they arise from within the Canvas adaptors (i.e. harnessing native canvas backend events)?
    • Are they provided to the Canvas model (i.e. intercepted from the gui backend before they reach the canvas)?
  • How might the user listen for an event?
    • Connect to signals on individual Nodes?
    • Interact with some independent structure?
  • How do we implement default behavior?
    • How do we block default behavior when user behavior should take precedence?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions