jerryd - if the other posters are correct and you're talking about codes, then I think you're going to need to understand what the remote is spitting out first... whether it be in the SIRC, RC5 or NEC protocol... or something else. I'm no expert, but what I do know is that I would never have managed to decipher what my remote was spitting out (NEC Extended protocol, by the way) until I hooked it up to a logic analyser - from there it was easy... well, simple. As long as you don't have a clue what the remote is spitting out you have pretty much no chance of deciphering the addresses and commands that it is sending on each press of a button.
Once you know what is being sent, you can write an algorithm to decipher the values being sent... in my Extended NEC case, a 9ms pulse, a 4.5ms pulse then 32 bits (represented by a pulse followed by a different delay for 0 and 1) representing the address (first 16 bits) and then the command (last 16 bits, but I only bothered in reading the first 8 bits) with parity. Once you're there, you're finally distinguishing between different button presses.