The keycapture module offers an API for global capturing of key events. The keycapture module provides the KeyCapturer object as a tool for listening to events.
The KeyCapturer object uses a callback method to report the key events. The callback method is called each time any of the specified keys is pressed.
Currently the keycapture module does not support capturing separate key-up or key-down events.