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

Add EntityBuilder DSL methods to add extra mouse event handlers, similar to existing onClick #1196

Open
AlmasB opened this issue Aug 13, 2022 Discussed in #1099 · 1 comment

Comments

@AlmasB
Copy link
Owner

AlmasB commented Aug 13, 2022

Discussed in #1099

Originally posted by francescvc September 2, 2021
On entityBuilder() I can setup an onClick((ent)-> { ... }) but on the click code I can't make difference upon the button clicked, that is the left one or right one. ¿How can I attach different events to both mousebuttons, or how can I distinguish wich one was clicked?

@chengenzhao
Copy link
Contributor

chengenzhao commented Sep 2, 2022

how about a general method of mouse event
like

entityBuilder.onMouseEvent((entity, event) -> {
  if(event instanceof MouseDragEvent dragEvent){
    //drag event handler
  }else{
    //other normal mouse event handler
  }
});

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants