hotkeys-js icon indicating copy to clipboard operation
hotkeys-js copied to clipboard

cannot detect shift keyup event

Open danhk0612 opened this issue 3 years ago • 4 comments

hotkeys("shift", { keyup: true }, function (evn, handler) { // eventFunction... }

if i press shift key, doesnt execute event function.

danhk0612 avatar Feb 04 '21 09:02 danhk0612

@danhk0612

hotkeys('*', function() {
  if (hotkeys.shift) {
    console.log('shift is pressed!');
  }
});

jaywcjlove avatar Feb 04 '21 09:02 jaywcjlove

+1 doesn't work for me either @danhk0612 did you find a workaround?

nc avatar Jul 16 '21 12:07 nc

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.

mattanimation avatar Sep 15 '21 00:09 mattanimation

same thing, using the keyup doesn't work either

codingedgar avatar Nov 22 '21 15:11 codingedgar