Return a duration with the queue (not a bare int)

This commit is contained in:
Marc Brooks 2025-11-05 14:54:40 -06:00
parent da8c82da34
commit 8de61db3d8
No known key found for this signature in database
GPG Key ID: 583A6AF2D6AE1DC6
1 changed files with 6 additions and 5 deletions

View File

@ -42,16 +42,17 @@ const (
func GetQueueIndex(messageType MessageType) (int, time.Duration) { func GetQueueIndex(messageType MessageType) (int, time.Duration) {
switch messageType { switch messageType {
case TypeHandshake: case TypeHandshake:
return HandshakeQueue, 1 return HandshakeQueue, 1 * time.Second
case TypeKeyboardReport, TypeKeypressReport, TypeKeyboardLedState, TypeKeydownState, TypeKeyboardMacroState: case TypeKeyboardReport, TypeKeypressReport, TypeKeyboardLedState, TypeKeydownState, TypeKeyboardMacroState:
return KeyboardQueue, 1 return KeyboardQueue, 1 * time.Second
case TypePointerReport, TypeMouseReport, TypeWheelReport: case TypePointerReport, TypeMouseReport, TypeWheelReport:
return MouseQueue, 1 return MouseQueue, 1 * time.Second
// we don't want to block the queue for these messages // we don't want to block the queue for these messages
case TypeKeyboardMacroReport, TypeCancelKeyboardMacroReport, TypeKeyboardMacroTokenState: case TypeKeyboardMacroReport, TypeCancelKeyboardMacroReport, TypeKeyboardMacroTokenState:
return MacroQueue, 60 // 1 minute timeout return MacroQueue, 60 * time.Second
default: default:
return OtherQueue, 5 return OtherQueue, 5 * time.Second
} }
} }