MouseEventControl / CursorEventControl, clicks that doesn't go through these

Hi

I’ve added listeners to my ‘enemy’ models, which works fine. However, I’d like clicks that doesn’t go through these to be registered somehow as well - is that possible?

For instance, when selecting an enemy, a small information camera pops up, displaying the selected unit and displaying some information about this unit. Now, I’d like to remove this display if the player clicks anywhere else. Is this possible?

Kind regards,
Asser

@asser.fahrenholz said: Hi

I’ve added listeners to my ‘enemy’ models, which works fine. However, I’d like clicks that doesn’t go through these to be registered somehow as well - is that possible?

For instance, when selecting an enemy, a small information camera pops up, displaying the selected unit and displaying some information about this unit. Now, I’d like to remove this display if the player clicks anywhere else. Is this possible?

Kind regards,
Asser

The best way might be to just register a regular mouse button handler with InputMapper. I’m 90% sure this will be run after any picking and 70% sure that there might be a way to use the event’s consumed state. Even if not there will be some way you can juggle a flag or something. I’m hoping the easy way works, though.

FYI, the inputmapper doesn’t fire the listener if the event is consumed through the lemur listener.

But this actually saves me - because then I know that if the inputmapper fires, I can disable the info-view.

@asser.fahrenholz said: FYI, the inputmapper doesn't fire the listener if the event is consumed through the lemur listener.

But this actually saves me - because then I know that if the inputmapper fires, I can disable the info-view.

Yeah, I hoped it would be that way since then the job is as easy as possible. It does exactly what you want. I just wasn’t sure I’d made that all work properly.