Releases: JohannesKlauss/react-hotkeys-hook
v4.6.1
What's Changed
- Consider custom element when checking if event is by @HJK181 in #1164
- Bump http-proxy-middleware from 2.0.6 to 2.0.7 in /documentation by @dependabot in #1217
- Bump express from 4.19.2 to 4.21.0 in /documentation by @dependabot in #1210
New Contributors
Full Changelog: v4.6.0...v4.6.1
v4.6.0
What's Changed
- chore(deps): update all non-major dependencies by @renovate in #1204
- Feat: Helps to identify which Shortcut was triggered exactly by @prostoandrei in #1219
New Contributors
- @prostoandrei made their first contribution in #1219
Full Changelog: v4.5.1...v4.6.0
v4.5.1
What's Changed
- chore(deps): update all non-major dependencies by @renovate in #1136
- chore(deps): update dependency @types/react to v18.2.56 by @renovate in #1140
- fix: example code in use-hotkeys docs by @jvn4dev in #1142
- chore(deps): update actions/setup-node action to v4 by @renovate in #1141
- chore(deps): update actions/checkout action to v4 by @renovate in #1137
- chore(deps): update all non-major dependencies by @renovate in #1147
- chore(deps): update all non-major dependencies by @renovate in #1149
- chore(deps): update all non-major dependencies by @renovate in #1156
- chore(deps): update all non-major dependencies by @renovate in #1158
- chore(deps): update all non-major dependencies by @renovate in #1162
- chore(deps): update all non-major dependencies by @renovate in #1166
- chore(deps): update dependency @types/react to v18.2.79 by @renovate in #1169
- chore(deps): update all non-major dependencies by @renovate in #1171
- chore(deps): update all non-major dependencies to v7.24.5 by @renovate in #1173
- chore(deps): update dependency @types/react to v18.3.2 by @renovate in #1175
- chore(deps): update all non-major dependencies by @renovate in #1178
- chore(deps): update dependency eslint-plugin-react to v7.34.2 by @renovate in #1182
- chore(deps): update all non-major dependencies by @renovate in #1185
- Fix: example code in is-hotkey-pressed docs by @nakker1218 in #1184
- fix(deps): update dependency clsx to v2 by @renovate in #1174
- chore(deps): update testing-library monorepo (major) - autoclosed by @renovate in #1170
- chore(deps): update typescript-eslint monorepo to v7 (major) by @renovate in #1159
- Bump follow-redirects from 1.15.0 to 1.15.4 in /documentation by @dependabot in #1118
- chore(deps): update all non-major dependencies by @renovate in #1192
- chore(deps): update all non-major dependencies by @renovate in #1196
- Update README.md by @stt045 in #1194
- Bump braces from 3.0.2 to 3.0.3 in /documentation by @dependabot in #1193
- Bump ws from 7.5.7 to 7.5.10 in /documentation by @dependabot in #1191
- Bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /documentation by @dependabot in #1190
- Bump express from 4.18.1 to 4.19.2 in /documentation by @dependabot in #1189
- Bump follow-redirects from 1.15.4 to 1.15.6 in /documentation by @dependabot in #1188
- chore(deps): update all non-major dependencies by @renovate in #1197
- chore(deps): update all non-major dependencies by @renovate in #1199
- Bump ws by @dependabot in #1201
- chore(deps): update typescript-eslint monorepo to v8 (major) by @renovate in #1200
- chore(deps): update all non-major dependencies to v8.0.1 by @renovate in #1202
- Fix default value for mapKey by @nperez0111 in #1124
- React to ref changes by @zeorin in #1132
New Contributors
- @jvn4dev made their first contribution in #1142
- @nakker1218 made their first contribution in #1184
- @stt045 made their first contribution in #1194
- @nperez0111 made their first contribution in #1124
- @zeorin made their first contribution in #1132
Full Changelog: v4.5.0...v4.5.1
v.5.0.0-1
🎉 First stable Pre Release for Version 5!
Most users should not need to do any migration, but for those who use special characters (+,-/$? and so on) or a different delimiter key than +
there is a bit of work to do.
🚨 Breaking Changes
<HotkeysProvider>
enabledScopes
in theHotkeysProvider
has been renamed toactiveScopes
- If all scopes are disabled in the
HotkeysProvider
no hotkeys will be active
useHotkeys
- The hook now only listens to the code of the hotkey, not the produced key. This will get rid of all the confusion between different keyboard layouts, multiple accidental triggers and so on.
- Special character mappings to the german keyboard layout code have been removed
- The
splitKey
option has been renamed todelimiter
- The
combinationKey
option has been renamed todelimiter
- New Option
useKey
: Setting this to true will listen to the produced key rather than the code. Helpful if you want to listen to something like?
,+
,!
...
🐛 Bugfixes
- Fixed a bug where listening to
control
instead ofctrl
wouldn't trigger correctly
Migration Guide
- If you are using the
splitKey
option, rename that todelimiter
- If you are using the
combinationKey
option, rename that tosplitKey
If you are listening to special characters like shift+1
in order to listen for the exclamation mark, rewrite your hook like so:
useHotkeys('!', callback, {useKey: true})
This will listen to the produced key instead of the code. Listening for shift is not necessary anymore, because the hook will only check if the produced key matches !
, no matter how it has been produced. This will be layout agnostic.
If you want to listen to specifically shift+1
, then use the hotkey like this:
useHotkeys('shift+1', callback)
useKey
defaults to false
, so you only need to set it, if you want to listen to special characters.
One common use case for this is listening to y
and z
. On a german layout those keys are swapped. So to comply with every possible keyboard layout, you would set useKey: true
to listen to the produced key.
useHotkeys('y', callback, {useKey: true}) // Triggers if the user hits their y key on the keyboard depending on the layout
useHotkeys('y', callback) // Triggers if the user hits the y key implying US keyboard layout
v4.5.0
What's Changed
- Added clean keys while recording by @DmitriiAlekseenko in #1129
New Contributors
- @DmitriiAlekseenko made their first contribution in #1129
Full Changelog: v4.4.4...v4.5.0
v4.4.4
v4.4.3
What's Changed
- Call ignoreEventWhen callback only on hotkey matches by @LuanScudeler in #1096
- Fix CI (update triggers, format files) by @kachkaev in #1105
- fix: focus trap did not work for shadow root by @artchen-db in #1108
- chore(deps): update dependency typescript to v5.3.3 by @renovate in #1106
- chore(deps): update dependency @testing-library/user-event to v14.5.2 by @renovate in #1097
- chore(deps): update dependency tslib to v2.6.2 by @renovate in #1102
- chore(deps): update dependency @testing-library/react to v14.1.2 by @renovate in #1094
- chore(deps): update react monorepo by @renovate in #1093
- chore(deps): update dependency @types/jest to v29.5.11 by @renovate in #1092
- chore(deps): update babel monorepo by @renovate in #1091
New Contributors
- @artchen-db made their first contribution in #1108
Full Changelog: v4.4.2...v4.4.3
v4.4.2
What's Changed
- Improve words in hook API docs by @jrysana in #1050
- chore(deps): update jest monorepo by @renovate in #1053
- chore(deps): update react monorepo by @renovate in #1054
- Tiny fix: correct name of enableScope/disableScope in README and test description. by @rewbs in #1056
- chore(deps): update dependency @types/react to v18.2.17 by @renovate in #1059
- chore(deps): update jest monorepo to v29.6.2 by @renovate in #1060
- Bump word-wrap from 1.2.3 to 1.2.4 by @dependabot in #1055
- chore(deps): update dependency @types/react to v18.2.18 by @renovate in #1061
- fix(deps): update dependency react-hotkeys-hook to v4.4.1 by @renovate in #1062
- chore(deps): update dependency @types/react to v18.2.20 by @renovate in #1065
- fix(deps): update docusaurus monorepo to v2.4.1 by @renovate in #1066
- chore(deps): update dependency @types/react to v18.2.21 by @renovate in #1071
- chore(deps): update jest monorepo by @renovate in #1072
- chore(deps): update babel monorepo by @renovate in #1075
- chore(deps): update dependency @testing-library/jest-dom to v5.17.0 by @renovate in #1076
- chore(deps): update jest monorepo by @renovate in #1078
- chore(deps): update react monorepo by @renovate in #1079
- chore(deps): update react monorepo by @renovate in #1082
- fix(deps): update docusaurus monorepo to v2.4.3 by @renovate in #1083
- chore(deps): update react monorepo by @renovate in #1084
- chore(deps): update babel monorepo to v7.23.2 by @renovate in #1085
- chore(deps): update dependency @types/jest to v29.5.6 by @renovate in #1088
- chore(deps): update react monorepo by @renovate in #1089
- Fix: duplicate hotkey activiation by @brendanlaschke in #1080
- Bump postcss from 8.4.14 to 8.4.31 in /documentation by @dependabot in #1081
- Bump @babel/traverse from 7.18.0 to 7.23.2 in /documentation by @dependabot in #1086
- Fix repository link by @kachkaev in #1103
New Contributors
- @jrysana made their first contribution in #1050
- @rewbs made their first contribution in #1056
- @brendanlaschke made their first contribution in #1080
- @kachkaev made their first contribution in #1103
Full Changelog: v4.4.1...v4.4.2
v4.4.1
What's Changed
- fix(deps): update dependency react-hotkeys-hook to v4.4.0 by @renovate in #1004
- Bump ansi-regex from 5.0.0 to 5.0.1 by @dependabot in #1002
- chore(deps): update dependency eslint to v8.38.0 by @renovate in #1001
- chore(deps): update dependency prettier to v2.8.8 by @renovate in #1011
- chore(deps): update dependency eslint to v8.39.0 by @renovate in #1010
- chore(deps): update dependency @types/jest to v29.5.1 by @renovate in #1009
- chore(deps): update typescript-eslint monorepo to v5.59.1 by @renovate in #1008
- chore(deps): update react monorepo by @renovate in #1007
- doc: Fix HotkeysProvider in documentation by @fineup in #1021
- chore(deps): update react monorepo by @renovate in #1020
- chore(deps): update babel monorepo by @renovate in #1016
- chore(deps): update typescript-eslint monorepo to v5.59.2 by @renovate in #1017
- fix(deps): update dependency @svgr/webpack to v8 by @renovate in #1025
- chore(deps): update typescript-eslint monorepo to v5.59.5 - autoclosed by @renovate in #1024
- chore(deps): update dependency eslint to v8.40.0 by @renovate in #1023
- chore(deps): update react monorepo by @renovate in #1022
- Fix typo (expect to except) by @Ampit in #1028
- chore(deps): update dependency tslib to v2.5.2 by @renovate in #1030
- chore(deps): update typescript-eslint monorepo to v5.59.6 by @renovate in #1031
- Handle readonly arrays in options as we do not modify them. by @pcorpet in #1029
- Fix: Update documentation by @JohannesKlauss in #1043
- chore(deps): update dependency @types/jest to v29.5.2 by @renovate in #1036
- chore(deps): update dependency tslib to v2.5.3 by @renovate in #1037
- chore(deps): update react monorepo by @renovate in #1032
- chore(deps): update typescript-eslint monorepo to v5.60.0 by @renovate in #1033
- Add more type exports to index.ts by @LuanScudeler in #1048
New Contributors
- @fineup made their first contribution in #1021
- @Ampit made their first contribution in #1028
- @pcorpet made their first contribution in #1029
- @LuanScudeler made their first contribution in #1048
Full Changelog: v4.4.0...v4.4.1
v4.4.0
What's Changed
- Bump @sideway/formula from 3.0.0 to 3.0.1 in /documentation by @dependabot in #976
- Update dependency typescript to v5 by @renovate in #985
- Update dependency eslint to v8.36.0 by @renovate in #983
- Bump webpack from 5.74.0 to 5.76.1 in /documentation by @dependabot in #982
- Update dependency @babel/core to v7.21.3 by @renovate in #981
- Update dependency react-hotkeys-hook to v4.3.8 by @renovate in #978
- Update dependency @types/jest to v29.5.0 by @renovate in #977
- Update typescript-eslint monorepo to v5.55.0 by @renovate in #979
- Update dependency prettier to v2.8.5 by @renovate in #986
- Update typescript-eslint monorepo to v5.56.0 by @renovate in #987
- Update dependency prettier to v2.8.6 by @renovate in #988
- Update docusaurus monorepo to v2.4.0 by @renovate in #990
- Feat: Expose descriptions for currently-bound hotkeys. by @zenzen-sol in #972
- Update dependency prettier to v2.8.7 by @renovate in #991
- Update babel monorepo to v7.21.4 by @renovate in #999
- Update dependency typescript to v5.0.4 by @renovate in #998
- Update dependency eslint to v8.38.0 by @renovate in #997
- Update typescript-eslint monorepo to v5.58.0 by @renovate in #996
- Update dependency @types/react to v18.0.35 by @renovate in #994
- [feature]: ignoreEventCondition option by @alpinagyok in #980
- Update dependency @svgr/webpack to v7 by @renovate in #992
- Switch to npm by @JohannesKlauss in #1000
New Contributors
- @zenzen-sol made their first contribution in #972
- @alpinagyok made their first contribution in #980
Full Changelog: v4.3.8...v4.4.0