Keyboard shortcut plugin

This plugin adds kbd:down|key|modifier and kbd:up|key|modifier attributes. The first token selects the keyboard phase, the second matches KeyboardEvent.key, and the remaining tokens specify exact modifiers (ctrl, alt, shift, or meta).

Press and release Ctrl+K to see the global key events.

The plugin ignores repeated keydown events and shortcuts originating in editable controls. Each listener uses the element's batsignal lifecycle signal, so it is removed when batsignal destroys that element.

Plugin code