Pulse-Eight / libcec

USB CEC Adapter communication Library http://libcec.pulse-eight.com/
Other
705 stars 282 forks source link

Keycodes defined in `cectypes.h` do not always match depending on TV manufacturer #590

Open PureTryOut opened 2 years ago

PureTryOut commented 2 years ago

Yeah, fun, I know...

As an example, while my Philips Android TV reports CEC_USER_CONTROL_CODE_F2_RED when I press the red button, for another developer of my program that same button returns CEC_USER_CONTROL_CODE_EJECT instead. His device seems to think the CEC device is a playback device and remaps buttons for it and seems to refuse to believe otherwise. We do set our device type though:

cecConfig.deviceTypes.Add(CEC_DEVICE_TYPE_RECORDING_DEVICE);

So now my application has to map the controls in a config file and allow the user to change it the first time they're launching it using some kind of wizard. Is the CEC standard that badly defined? Is there anything libcec can do so the application developer doesn't have to make such annoying workarounds involving more user UX?