TRS Expression pedal and Foot Controller/Sustain Pedal

Hello to everyone, I need help and hints to projecting this part of my MIDI foot controller. I'm using the Control Surface MIDI library.
My objective is to connect an expression pedal TRS or a sustain pedal TS (no ring on the male plug) to a pro micro via this 6 pins TRS female plug you can see in photo



In the second photo, with the male jack inserted, you can see contact interrupted between pins.

As you can see left pins and right pins are connected, but if you plug in the male plug it interrupts the connections between the right pins and the left pins.
At the moment I had some little problems and that's how I solved 'em, but I don't know if it is the right way.
1- I connecetd Sleeve to GND and Ring or Tip to a 1K resistor to +5V to avoid pro micro turns off while pluging in or out the male plug.
2-when male jack is not plugged I noticed that noise turns randomly the knob in my music software, so I connected the A0 on pro micro to ring or tip (the other but the 5V) and then the left pin (if you look thr female jack from the rear) to GND so when the male jack is not inserted A0 goes directly to GND stop doing random noise.
Keep in mind that the exp pedal (TRS) gives me a raw valor between 0 - 15000 and sus pedal (TS) gives 16-64.
My goal is to connect the exp pedal or the sus pedal on the need possibly without switching manually a switch.

Every help would be really appretiated!
Thank you for reading, Luca.

We don't know anything about your circuit but that's a "closed circuit" jack. It's normally used to disconnect speakers when you plug-in headphones.

You don't have to use the switched connections but in your case it could be used so you don't get a floating input with nothing plugged-in. (Maybe that's what you're doing.)

This is what I realized actually (see attachments).



Both vesrion seems to work well but working values range of the exp and sus pedals change! As you can see I named the pins with a letter (TRS) and a number: when tha male jack is not inserted pins 1 and pins 2 are connected among them; when male jack is inserted only pins 1 are connected to the male jack.
I want your help to make the best circuit keeping in mind that exp pedal is TRS and sus pedal is TS and their work range I can read on the pro micro serial port is very different. Is there a way to let them operate in the same range? how?

Thanks for your time!

For the moment I solved the problem with a switch, but that's not what I want! I'd like the circuit switches itself when I insert a TS jack (S1 and R1 will be shortcircuited by the mono jack itself). Is there any way to do it?