Skip to content

Commit 8de61db

Browse files
committed
Return a duration with the queue (not a bare int)
1 parent da8c82d commit 8de61db

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

internal/hidrpc/hidrpc.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,17 @@ const (
4242
func GetQueueIndex(messageType MessageType) (int, time.Duration) {
4343
switch messageType {
4444
case TypeHandshake:
45-
return HandshakeQueue, 1
45+
return HandshakeQueue, 1 * time.Second
4646
case TypeKeyboardReport, TypeKeypressReport, TypeKeyboardLedState, TypeKeydownState, TypeKeyboardMacroState:
47-
return KeyboardQueue, 1
47+
return KeyboardQueue, 1 * time.Second
4848
case TypePointerReport, TypeMouseReport, TypeWheelReport:
49-
return MouseQueue, 1
49+
return MouseQueue, 1 * time.Second
5050
// we don't want to block the queue for these messages
5151
case TypeKeyboardMacroReport, TypeCancelKeyboardMacroReport, TypeKeyboardMacroTokenState:
52-
return MacroQueue, 60 // 1 minute timeout
52+
return MacroQueue, 60 * time.Second
5353
default:
54-
return OtherQueue, 5
54+
return OtherQueue, 5 * time.Second
55+
5556
}
5657
}
5758

0 commit comments

Comments
 (0)