Open stwilz opened 1 year ago
Hi! Just migrated from v3 to v4 and noticed that our returned keys doesn't include modifiers?
keys
Previously we did these ones.
const HOTKEYS = [ { keys: 'ctrl+alt+s', type: 'save', }, { keys: 'ctrl+alt+f', type: 'find', }, ] useHotkeys( HOTKEYS.map(hotkey => hotkey.keys).join(','), (_, { key }) => setActive(HOTKEYS.find(({ keys }) => keys === key)?.type || null) )
Which was pretty straight forward but now we've needed to put in some extra smarts to match the callbacks. Is not including the modifiers the expected behavior?
PS Great work on the library!
Ah yes, this is a design issue that will be fixed in version 5. Thank you for reporting this
Hi! Just migrated from v3 to v4 and noticed that our returned
keys
doesn't include modifiers?Previously we did these ones.
Which was pretty straight forward but now we've needed to put in some extra smarts to match the callbacks. Is not including the modifiers the expected behavior?
PS Great work on the library!