Is it possible to execute an action when I double click (in a certain application)?

I am using PHPStorm and I want it so that when I double click, it will check to see if selected text matches a Jira Ticket, and then run another command.

Is this possible?