The main mechanism of getting the key listener to work with the UI are XBL bindings - these need to obviously be replaced.
Within Composer it would interesting to run the code from a content script - John Bieling gave a minimal example - see attached zip file.
_contentScripts.zip