Hi Mau,
You chose to use the feature that in my opinion works the worst with the Codey.
With a makeblock controller like the mBlot it would have been easier.

Here’s the code to use a TV controller and turn on the TV later

However, the ability to register multiple keys is required to do what you want. Conclusion: Codey will not activate with a TV controller as there is no instruction to empty the receiving variable. As a result, my code displays A and B a repetition of randomly.
Does not work
Finally, the functionality is actually less interesting. However, I keep hoping that one day Makeblock will allow the recording of several keys. Let’s pray together;)