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

Allow adding EventHandlers #2576

Open
pauldendulk opened this issue Apr 1, 2024 · 0 comments
Open

Allow adding EventHandlers #2576

pauldendulk opened this issue Apr 1, 2024 · 0 comments

Comments

@pauldendulk
Copy link
Member

The problem
In 5.0.0-beta.1 it is not possible for users to add event handlers for the PointerPressed, PointerMoved, PointerReleased, Tapped events, like there is for Info. They do not exist for the MapControl and for Widgets.

The proposed solution
They need to be added. For widgets I was thinking to add them to the BaseWidget so that all widgets handle all events. Questions:

  • Should they be weak references. Would this mean an assigned lambda could be cleaned up?
  • How should they be named? For the MapControls the names above will collide with existing events. And for widgets we could use the names above, but perhaps we want the same names for the MapControl and the Widgets. Some options:
    • MapPointerPressed
    • MapsuiPointerPressed
    • MPointerPressed
    • MapPointerPressed and WidgetPointerPressed
    • MapPointerPressed and PointerPressed
  • With all events on a TextBoxWidget it would become identical to a ButtonWidget. Is this is a problem?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant