Keystrokes Versions Save

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.

v1.1.1

10 months ago

Fixes an issue with combos containing the shift key in which they would not be triggered correctly.

v1.1.0

10 months ago

This release introduces a new method on Keystrokes - checkKeyComboSequenceIndex. It will return the sequence index of the combo - 0 if the combo is not active at all. For each sequence active within the combo the returned value will be incremented. So for a combo like g,o if g is pressed then the returned index will be 1. If then g is released and o is pressed the index will be 2. Once o is released the index will be 0 again.

It also updates bindEnvironment to optionally take onActive, onInactive, onKeyPressed, onKeyReleased, mapKeyComboEvent, selfReleasingKeys, and keyRemap in an options object exactly like the Keystrokes constructor.

Lastly I've updated the readme to better explain how combo operators work.

Thanks to @pilliq for suggesting the idea that led to checkKeyComboSequenceIndex's implementation.

v1.0.2

10 months ago

This release is an important one. It introduces a fix for Mac where the command key will not fire a keyup event. This is actually caused by a browser/os bug but I had fixed this before in KeyboardJS. This time I've fixed the issue in the browser bind layer so the library does not contain special browser specific logic. The other important change is it seems Parcel was corrupting the react and vue packages. I've since removed parcel and moved to vite and vitest. Things seem much better now.

I recommend upgrading to this release whenever you can. As always if you run into any issues please report them. It is only a patch release as non of these changes change the interface of the library.

Special thanks to @colinsullivan for finding an issue with self releasing keys, and @NinjaNas for reporting an issue with the react package.

v1.0.0-beta.12

1 year ago

Added first class support for vue with a new package with a similar set of functionality to the react package.

v1.0.0-beta.10

1 year ago

This release adds first class support for react with the introduction of @rwh/react-keystrokes.

I've also converted to the repository to a monorepo. I will be adding more packages as I add support for more frameworks. If you have any ideas for frameworks you'd like to see supported let me know via Issues.

This release also adds support for replacing the global instance, and creating a special version of keystrokes meant for tests. This should enable you to write better tests for any logic driven by keystrokes.

v1.0.0-beta.4

1 year ago

One step closer to v1, this release is the first beta I'm happy with. I've switched the build system to parcel, and we now produce both commonjs and esmodule compatible source.

v1.0.0-alpha.7

1 year ago

The first alpha release I feel is solid enough to let people kick the tires. This release contains the initial functionality of the library and should have a readme usable enough to get started with the library. Please test it out and provide any feedback you can.