mirror of https://github.com/jetkvm/kvm.git
Return a duration with the queue (not a bare int)
This commit is contained in:
parent
da8c82da34
commit
8de61db3d8
|
|
@ -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
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue