Some keyboard events (dead keys, modifier-only presses) have e.key
as undefined. Similarly, malformed shortcut definitions may lack a key.
Added early-return guards to prevent TypeError.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Modifiers (shift, alt, meta) are now checked in both directions:
when not required, the physical key must NOT be pressed either.
Before: Cmd+K shortcut would fire on Cmd+Shift+K or Cmd+Alt+K.
After: exact modifier combination is enforced.
4 regression tests added.