is there a way to check if an led is lit via switch?

Suppose I have three led's set up and a mechanical switch for each. The led anodes go to arguino pins via resistors, the led cathodes go to each mechanical switch and then to ground. The arguino sends a HIGH command to each led but only the one with the switch engaged lights up. That is the setup.

Now, is there a way to recognize that an led is lit and to be able to set a condition based on that confirmation. I would like to use a selector switch but not have it directly plugged into the arguino.

Thanks for any suggestions.

So something like this, with 2 pins per LED?
Drive the anode high, sense if the cathode is low.
Can be all digital.

Thank you. Ill give it a go as soon as I can. Question though...pin 5 would be an output and pin 4 an input? Thanks.

Output to anode, input to switch, whatever pair you use.

Hi, you might want to try setting your output pins to INPUT_PULLUP and using digitalRead() to read the pin. If the switch is not pressed, the reading will be HIGH. If the switch is pressed, the reading might be LOW. Worth a try, because if it does work, it won't use any more Arduino pins.

With INPUT_PULLUP, the led will be very dim, so use the setting only while reading the pin, then immediately set it back to OUTPUT.

Paul