I have two momentary switches called IR and IB. If I press just IR, then on my computer, the letter A is shown. If I press just IB, the letter B is shown. And if I press both of them, the letter C is shown.
While the code seems obvious, the problem is, I would have to press both inputs at exactly the same time to register a keypress of C without accidentally registering a keypress of A or B.
If anyone one knows an algorithm or pseudo code to solve this problem, I would be down to hear it.
I don't know if this is what you were expecting but if you take pyinput module and make the thread wait like 0.35 second between two inputs and if both are A and B you display C
Algorith to detect if two inputs are pressed in a loop without pressing them at exactly the same time