check that a handler is actually registered in ShortcutManager.handles

there are a few shortcuts that do not specify handlers
(just for quick help contents),
and this was preventing the actual events from ever firing.
Merge pull request #5451 from minrk/comment-shortcut

check that a handler is actually registered in ShortcutManager.handles