3.5mm headphone as button or switch

I’m hanging on Robins reply #1
If the OP can explain what they have, and what they. are trying to do - we may be able to help.