Open YuxuanWeng opened 1 year ago
@YuxuanWeng Your fix has been reverted because it caused some problems with scope
. #434
https://codesandbox.io/s/eager-pond-cstwrz?file=/src/App.tsx @jaywcjlove 大佬可以看下这个case吗?先按住cmd再按住k,getPressedKeyString的结果会出现k+cmd,而不是cmd+k
先摁的 k
键,再摁 cmd
会出现这种问题,我想了一下,如果先摁 c
再摁 cmd
也不能复制
重现问题
按住 cmd
,第一次按 k
返回 cmd+k
, 不松开 cmd
第二次按 k
返回 k+cmd
I discovered that when using
hotkeys('*', {keyup:true, keydown:true}, handler)
, with thekeyup
andkeydown
options set to true, if there are otherhotkeys('*', {}, handler2)
listeners present, the_downKeys
order gets rearranged. This causes an issue when I'm implementing keyboard shortcuts persistence because the order ofkeycodes
retrieved usinggetPressedKeyCodes
after keyup is incorrect.Here is the reproducible link: https://codesandbox.io/s/eager-pond-cstwrz?file=/src/App.tsx