Google recently announced that Chromecast now supports HDMI-CEC controls.
https://plus.google.com/+LeonNicholls/posts/FyGeJavgmX3
I would like the implement the functionality in my app. I have tested with Youtube and my TV and it works. How can I implement the same thing in the receiver portion of my Chromecast app? I have tried listening for key events, but that doesn't seem to pick anything up. Any ideas?
As long as you use the Media Manager on the receiver side (the recommended approach), you shouldn't need to do anything special.
As stated in your article, it's basically only the Google Cast media namespace
namespace that supports HDMI-CEC, so basically for custom receiver apps, the answer is no. For media namespace apps, just implement the API and it should work automatically.
I know the media HDMI-CEC support includes turning on the TV, switching to the ChromeCast input, pause and play. It's possible it also includes volume (including mute) and seeking as these are also media playback messages defined in that API.
It might be cool if you could use those buttons to control a custom receiver running on the CC but I suspect that the only way to do that is to generate a video in the sender and stream that to the CC, generating new video based on remote control interaction. I.e. An expensive and rather indirect way.
On the other hand - as a proof of concept maybe that would encourage google to open the HDMI-CEC API to non-media apps.