Fun little puzzle

I have 5 to 1 HDMI switch that I lost it's remote.BUT the switch provides manual button that can CIRCULATE the 5 inputs. Each input selected has it's LED marked with Input 1....5

So, by pressing the button I can switch between INPUTS to select which HDMI device I want for output.

NOW, I want to avoid the manual operation. I located the button 2 pins One 5 v and the other GND
When I press the button the 5V goes to ground and the INPUT LED MOVES TO THE NEXT input.

What I want to do is to have arduino do the 5V to GND AND determine WHICH input it is at.
Once Arduino detected which LED is ON, it display it's ID.

Let me iterate:

The box has a button when I press it once a LED with ID is ON so I know that that input is selected for output ( TV). If I keep pressing the same button I go to the next input and thus circulate through the 5 inputs until I decide which one I want for output.

The wiring will be ONE to emulate the button, and 5 pins to detect which LED is HIGH

and then the display wiring which will be I2c

This is a poor-man schematic.

What's the make and model of the switch? Easy enough to get the IR codes.

Here are the "Board Details"

A76-R077029

HSW0501S

This is a Chinese product The outside info "HDMI Switcher" and that is IT.

No model number

The google serach for HSW0501S

https://www.google.com.eg/search?q=HSW0501S&rlz=1C1VFKB_enEG722EG722&tbm=isch&tbo=u&source=univ&sa=X&ved=2ahUKEwigteyYre_eAhXFAewKHbYoD0UQsAR6BAgDEAE&biw=1920&bih=1016

(deleted)

The question is:

How do I program the arduino to detect the ID of the led selected.
By using arduino to emulate the button, the code will detect which LED is High and display the ID.
If I need a different Input I just emulate the switch again.

Any IR remote with ANY IR code will do the trick of emulating the button.

I suspect the button is not internally generating an Ir pulse but sequencing a counter.

No the button is NOT generating any IR; it is simply circulating a "manual" selection. Every press move from input x to x+1 and when it reaches 5 it goes to 1