Keystrokes as an easy to use library for binding functions to keys and key combos. It can be used with any TypeScript or JavaScript project, even in non-browser environments.
This PR introduces new type arguments and a mapper function that can be passed as part of the libraries options. The new types allow adding custom event properties to the KeyEvent and KeyComboEvent respectively. The mapper function provides a way for deriving properties for KeyComboEvent from all KeyEvent objects involved in the combo.
This isn't likely isn't useful to users whom wish to use the library in the browser - more relevant to users who wish to use the library in other more custom situations. That said this work was motivated by and provided a way to solve issue #2.
This PR introduces new type arguments and a mapper function that can be passed as part of the libraries options. The new types allow adding custom event properties to the KeyEvent and KeyComboEvent respectively. The mapper function provides a way for deriving properties for KeyComboEvent from all KeyEvent objects involved in the combo.
This isn't likely isn't useful to users whom wish to use the library in the browser - more relevant to users who wish to use the library in other more custom situations. That said this work was motivated by and provided a way to solve issue #2.