first of all, state clearly which Tx and Rx you are using ??
If you are using simple IR LED as Tx and a 38/36/40 kHz detector at Rx, then for programming on the Tx side, make a function which will transmit a ASK waves at 38 khz. So, when 1st switch is pressed on the Tx side, you are sending something like 0x01 hex ( 0000 0001 b) which is ASK modulated on 38khz carrier. On the receiver, you have to implement a logic, which receives the pattern (no demodulation is required as it is already done in the receiver) 0x01. THis way, you know which pattern you have transmitted and based on the pattern, you can do anything at the receiver side.
Also, if you don't want to write a code for ASK modulation the 38khx carrier, than you can do one thing : Make a 38khz transmitter using 555 IC and apply a pin from microcontroller to the Reset pin of the 555 ckt. This way, whatever you will transmit on that pin, will be received at the Rx directly.