hotkeys-js
hotkeys-js copied to clipboard
cannot detect shift keyup event
hotkeys("shift", { keyup: true }, function (evn, handler) { // eventFunction... }
if i press shift key, doesnt execute event function.
@danhk0612
hotkeys('*', function() {
if (hotkeys.shift) {
console.log('shift is pressed!');
}
});
+1 doesn't work for me either @danhk0612 did you find a workaround?
using the asterisk works, but if one just wants to get the shift event then it doesn't work. I'm using the react hooks version and even this:
useHotkeys('⇪,shiftKey,shift', (k)=>{
console.log(k, hotkeys.getPressedKeyCodes());
}, {keydown:true, keyup:true})
doesn't work. I've tried each on their own too, but only if I use the *
does it work.
same thing, using the keyup
doesn't work either