You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am testing it out and I think the fundamental issue is that the triggering flag is shared across keys.
Thus when you type fast, e.g. keydown a -> keydown b -> keyup a -> keydown c -> keyup b -> keydown d -> keyup c -> ..., even keyup a occurs a while back, the triggering time still reach and the function is triggered.
What needs to happen is that each keydown has its own triggering time.
The entries are stored in an array, and when the keyup event occurs that entry needs to be removed.
The logic check what is the oldest triggering time to determine should the function execute.
A further enhancement is to allow each key to have its own triggering threshold. i.e.:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am testing it out and I think the fundamental issue is that the triggering flag is shared across keys.
Thus when you type fast, e.g.
keydown a -> keydown b -> keyup a -> keydown c -> keyup b -> keydown d -> keyup c -> ...
, evenkeyup a
occurs a while back, the triggering time still reach and the function is triggered.What needs to happen is that each
keydown
has its own triggering time.The entries are stored in an array, and when the
keyup
event occurs that entry needs to be removed.The logic check what is the oldest triggering time to determine should the function execute.
A further enhancement is to allow each key to have its own triggering threshold. i.e.:
Beta Was this translation helpful? Give feedback.
All reactions