reprogramming pc remote

Hi all
How would I go about reprogramming the buttons on my generic pc remote control. For instance there is a home key that when pressed it opens my browser but I use the remote to control kodi so when pressed it returns to the home screen on kodi, I think the keyboard action for this is ESC.
Thanks in advance