keyEvent === keyCombo.key && (!keyCombo.hasModifiers || ( /* exact match of modifiers */)
But sometimes you specifically want only an unmodified key, e.g. only the key z and not alt-z or shift-z etc. In particular, this is necessary when you want to register separate handlers for the modified and unmodified cases.
I suggest using the modifier only, for example:
key="z+only"
If only is combined with other modifiers it has no special effect because the matching logic tests all possible modifiers as soon as any one modifier is included.
I am about to submit a PR implementing this with the addition of 2 lines.
Currently, the main key matching logic is:
But sometimes you specifically want only an unmodified key, e.g. only the key
z
and notalt-z
orshift-z
etc. In particular, this is necessary when you want to register separate handlers for the modified and unmodified cases.I suggest using the modifier
only
, for example:If
only
is combined with other modifiers it has no special effect because the matching logic tests all possible modifiers as soon as any one modifier is included.I am about to submit a PR implementing this with the addition of 2 lines.