For the mouse click you can always do an additional 2d-vector near check to the clicked point. Cycling through all entities with ent_next() should not be that much of a problem as you don't click all the time.