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

feat: Include input events to obj.clearEvents() #621

Open
amyspark-ng opened this issue Mar 2, 2025 · 3 comments
Open

feat: Include input events to obj.clearEvents() #621

amyspark-ng opened this issue Mar 2, 2025 · 3 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@amyspark-ng
Copy link
Collaborator

Is your feature request related to a problem? Please describe.

If you do something like

obj.onMousePress("left", () => {
    debug.log("hello")
})

obj.clearEvents()

The onMousePress will still work despite onMousePress "being cleared" from the object, this clearEvents only works onUpdate and onDraw afaik

The event DOES get cleared when the object is destroyed i think, so i don't know why it happens this way

@amyspark-ng amyspark-ng added the enhancement New feature or request label Mar 2, 2025
@mflerackers
Copy link
Member

I works on all event except for input events. This is because input events are actually global and objects only hold a reference to the event, not the actual event.

@amyspark-ng
Copy link
Collaborator Author

Is there a reason why this is done this way?

@mflerackers
Copy link
Member

Only tga knows, and tga didn't wrote comments why.

@amyspark-ng amyspark-ng assigned amyspark-ng and lajbel and unassigned amyspark-ng Mar 3, 2025
@amyspark-ng amyspark-ng added this to the 4000 milestone Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

3 participants