Formerly Skinney/keyboard-events. Search finds this package by either name.
Send message when a given key is pressed while a certain Html element has focus.
The functions in this namespace uses the keyboard event api, which is supported in most browsers (including IE11).
This package makes use of a Keyboard custom type from the ohanhi/Keyboard package,
so you'll need that as a direct dependency.
Listen for the corresponding event, and trigger the message that corresponds with the
given Key. Works the same as Html.Events.on.
Works like on, but allows you to specify if the default action or propogation should be stopped
if a message is triggered.
Works like custom, but allows you to specify if the default action or propogation should be stopped
if a message is triggered for a specific Key.
When should a message be triggered?
Keydowntriggers when a key on your keyboard is pressed down.Keyuptriggers when a key is release.Keypressonly triggers if the key produces a character. If you want to trigger a message when the spacebar is pressed, useKeydowninstead.