How to add Listener to Diagram.lastInput

Hello. I am trying to add an Event Listener which would be called everytime diagram.lastInput's value is changed.

It would probably look like:

diagram.addModelChangedListener()

except this would be listening to changes on the Diagram itself and not just the diagram model.

P.s. the reason why I want to capture everytime lastInput changes is to create a handler for hovering over a particular targetObject which is returned and set to the InputEvent register in diagram.lastInput if that helps give you a larger context.

I’m not totally clear on what you want to do here, but is there a reason mouseOver wouldn’t be suitable?

What are you trying to do, more broadly? There’s no way to get notified every time lastInput changes, but something else might suffice.

Nope, you were dead on. mouseOver was what I was looking to use!