I will archive this since it seems to be a duplicate of How to add event listeners to my plugin code?