Now I know I can create an icon button and place that next to the field but the layouts in Apex basically suck and the icon is never where I want it to be

So if I add an icon to the field directly as above, is there a way to trigger a dynamic action on the click of the icon and not the filed as a whole ?