Ciao!
The IR works as a transmission medium, like sending morse code through light, pulses go in, pulses go out, nothing "smart" in the middle, the IR receiver only filters and demodulates IR pulses of certain frequency (38,40,42KHz...), ignoring everything else, it's the system (processor, mcu, SoC) reading the output pulses who has to decode the sequence and compare the result.
Normally there's no such thing of separate ON and OFF buttons, you might want to try searching the codes again, skipping the one you're currently using.