I suppose that I should use directive, but it seems strange to add directive to body, but listen events on document.
What is a proper way to do this?
UPDATE:
Here's an example of an AngularJS service for keyboard shortcuts: http://jsfiddle.net/firehist/nzUBg/
It can then be used like this:
function MyController($scope, $timeout, keyboardManager) {
// Bind ctrl+shift+d
keyboardManager.bind('ctrl+shift+d', function() {
console.log('Callback ctrl+shift+d');
});
}
Update: I'm now using angular-hotkeys instead.