Releases: RobertWHurst/Keystrokes
v1.5.6
v1.5.5
A small bugfix release. @se-panfilov discovered that key aliases were not working for checkKey or bindKey. This release resolves the issue by allowing the use of aliases for these functions in the same way they can be used for bindKeyCombo.
Special thanks to @se-panfilov for reporting the issue.
v1.5,4
This release fixes a bug introduced in v1.5.4 which broke combo handling. Make sure you upgrade any 1.5.x dependent projects to this release.
Thank you @Bernankez for reporting the issue.
v1.5.0
This release introduces the ability to bind code values with the default browser bindings. This is great for those who want to bind keys by their physical location on the keyboard rather than their key value.
To bind a code instead of key, prefix with @
. For example, to bind what is the A and B key on a US keyboard the combo @KeyA + @KeyB
can be used. This will bind keys in the same location on all other keyboards regardless of the label printed on the key or it's key value. See the readme for more information.
Special thanks to @vladdekhanov for suggesting this feature.
v1.3.0
This release introduces the ability to bind (and unbind) more than one key or combo at the same time. Thanks to @qiongshusheng for the suggestion.
bindKey(['a', 'b'], handleAOrB)
bindKeyCombo(['a+x', 'b+x'], handleAXOrBX)
v1.2.3
v1.2.1
This is a small but important release regarding how key repeat events are handled. When I wrote the logic that handles combo key repeat I assumed that the last key pressed is always the key the repeats, but this isn't the case. I discovered this while fixing #21. I've adjusted the logic which checks combos to store the last unit (keys that can be pressed in any order) of a combo rather than the last key pressed. This allows Keystrokes to check if the repeating key is part of the set, and thus combos properly work with key repeat even if pressed in strange orders with strange modifier keys 😅
Again thanks to @silverwind for reporting the issue that lead to this release.
v1.2.0
For this release of Keystrokes I've changed the way key combos are executed so that you can interact with events. This means that things like calling preventDefault are accounted for correctly. This is an important change, and a bit of an glaring omission in my opinion. In anycase it is now possible to call prevent default in a combo as follows:
bindKeyCombo('control > s', (event) => {
event.finalKeyEvent.preventDefault()
// ...
})
Special thanks to @silverwind for raising an issue about this.
v1.1.5
So this release includes a fix for the vue package which had been broken by me when moving from parcel to vite. There was also an issue where cjs files for commonjs projects where missing from the packages. Special thanks to @george-martinec for pointing out the broken import for the vue package.
v1.1.2
This is a rather small release which fixes a bug where setting up a key remap was not possible because it was not handled within bind environment as it should. Thanks to @DarkLight1337 for reporting the issue.