See this add-on on the kodi.tv showcase
Helper module to allow mapping Actions, Onfocus and click events via decorators