CEC and Samsung remote

I am using Rpi 2 and a Samsung remote.

Is there a way to programme the remote keys for specific commands such as

A key = favourite films
b = favourite TV

thanks

On my SAmsung remote I just hit tools, and have a menu item for CEC, click on that and select Kodi. It then works.

I have noticed if there is another source currently on that seems to have priority. I just switch it off (my sat) and do the above works fine.

bb