Text Field Capturing Mouse Events

I have a text field that needs to capture mouse events.

What I want to do is be able to know when a user clicks on the text box to edit the text. The text box is created dynamically, and right now I have the event handler triggering when the user types, but i’d like it when the text field itself becomes focused.

Any way to do this?