Performance issues: Keyboard events

I’m making an RTS game.

There is gonna be a lot of actor in the game like houses, blacksmiths and so on…

I’m storing the last actor that I clicked in an actor.

The problem: Lest say I want my selected actor to play an animation when a button pressed. The problem is that I need to set the “Auto Receive Input” to On in every one of the buildings. This count can get up to 500 on the late game so I’m not sure if this is the most optimal option.

Is there any better way to accomplish what I wanted? Or to optimize it?