RobertWHurst / Keystrokes

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.
MIT License
158 stars 6 forks source link

Fix self releasing keys and add fix for MacOS Command key goofiness #10

Closed RobertWHurst closed 1 year ago

RobertWHurst commented 1 year ago

This PR aims to fix the bug with self releasing keys found by @colinsullivan (much appreciated). It incorporates his test case and some ideas from is PR #9.

This PR also fixes an issue with MacOS where the command key does not fire a keyup event after another key is pressed. I fixed this issue by emitting an artificial keyup event when any other key is released, and intercept any real command keyup events (should Apple fix this issue, or no other keys are pressed).

RobertWHurst commented 1 year ago

Looking for your feedback @colinsullivan. Please also have a look at your PR #9 as I had some questions for you about the feature.

colinsullivan commented 1 year ago

nice, looks good!!