There are some problems with InputMapper

Yeah, because you want to consume it but you don’t want to consume it. It’s going to confuse a lot of things. I haven’t looked enough into your code to figure out where you are registering listeners and if there is more than one that might be reporting that, etc… your debug output leaves out some information.

…but if I had to guess, because you add the listener to the root node then anything the mouse is over will get the button event. Since nothing consumes it then it’s going to be delivered to everyone of those things.

That’s what consuming is for. To keep it from continuing on through whatever you clicked.

The easiest approach is the one I’ve given already.

You have two choices basically:

  1. play nice with spatial-based listeners and use them for everything. (ie: put a ground plane)
  2. do not use any spatial-based listeners at all ever never never and always do your own basic mouse handling, picking, etc.) ie: stop using CursorEvents for anything.

(1) seems like the easier way to me. Since no doubt you will have some UI elements at some time and (2) becomes super hard in that case.

1 Like