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
When a button is pressed repeatedly and faster than LongKeyPressInterval, the implementation of StreamDeckAction triggers falsely OnKeyLongPress.
The flow is as follows:
Button is pressed
OnKeyDown() puts the EventArgs on the stack and starts Task.Delay()
Button is released
OnKeyUp() successfully pops the EventArgs from the stack and thus calls OnKeyPress() (the callback for short keypress).
Problem: The Task.Delay() is still active and waiting.
Button is pressed again. This has to happen with 500ms after the first time that the button was pressed (or <= LongKeyPressInterval)
OnKeyDown() puts the EventArgs on the stack
Task.Delay() from the first button press finishes and successfully pops an event from the stack. Unfortunately, this is the event from the second button press and not from the first button press. In consequence, the callback OnKeyLongPresss() is getting called.
I think that TryHandleKeyPress() must also cancel Task.Delay() when it successfully popped an item from the stack.
The text was updated successfully, but these errors were encountered:
When a button is pressed repeatedly and faster than
LongKeyPressInterval
, the implementation ofStreamDeckAction
triggers falselyOnKeyLongPress
.The flow is as follows:
OnKeyDown()
puts the EventArgs on the stack and startsTask.Delay()
OnKeyUp()
successfully pops the EventArgs from the stack and thus callsOnKeyPress()
(the callback for short keypress).Task.Delay()
is still active and waiting.<= LongKeyPressInterval
)OnKeyDown()
puts the EventArgs on the stackTask.Delay()
from the first button press finishes and successfully pops an event from the stack. Unfortunately, this is the event from the second button press and not from the first button press. In consequence, the callbackOnKeyLongPresss()
is getting called.I think that
TryHandleKeyPress()
must also cancelTask.Delay()
when it successfully popped an item from the stack.The text was updated successfully, but these errors were encountered: