The target idea is quite simple: mouse_ent is the pointer to the entity that has the mouse pointer placed over it. You can then get the entity name / pointer, store it and do whatever you want with it.
Here's another idea: use enable_touch for any entity that will be sensitive to mouse touching and / or clicking.