Dynamic or Static polymorphism - what is better?

My project is pretty big and I won't be able to put it here.

I use Listener pattern , where multiple listeners need to react differently on a particular event(e.g. button is pressed and I need to display a message and run motor). Here I use runtime polymorphism as I am not sure if it is possible to do it with templates. Is it?

For different devices I also use runtime polymorphism but I can migrate to templates if it is beneficial.