EventHandler
EventHandler[expr,{event1:>action1,event2:>action2,…}] displays as expr, evaluating actioni whenever "eventi" occurs in connection with expr.
Please visit the official Wolfram Language Reference for more details and examples on core symbols.