bug: bad args order.

This commit is contained in:
m1k1o 2020-06-21 03:01:15 +02:00
parent 2fbf1e9ca4
commit 9ce26cffc5

View File

@ -128,14 +128,6 @@ func (h *MessageHandler) controlKeyboard(id string, session types.Session, paylo
h.remote.SetKeyboard(*payload.Layout) h.remote.SetKeyboard(*payload.Layout)
} }
// set caps lock
var CapsLock = 0
if payload.CapsLock == nil {
CapsLock = -1
} else if *payload.CapsLock {
CapsLock = 1
}
// set num lock // set num lock
var NumLock = 0 var NumLock = 0
if payload.NumLock == nil { if payload.NumLock == nil {
@ -144,6 +136,14 @@ func (h *MessageHandler) controlKeyboard(id string, session types.Session, paylo
NumLock = 1 NumLock = 1
} }
// set caps lock
var CapsLock = 0
if payload.CapsLock == nil {
CapsLock = -1
} else if *payload.CapsLock {
CapsLock = 1
}
// set scroll lock // set scroll lock
var ScrollLock = 0 var ScrollLock = 0
if payload.ScrollLock == nil { if payload.ScrollLock == nil {
@ -152,6 +152,6 @@ func (h *MessageHandler) controlKeyboard(id string, session types.Session, paylo
ScrollLock = 1 ScrollLock = 1
} }
h.remote.SetKeyboardModifiers(CapsLock, NumLock, ScrollLock) h.remote.SetKeyboardModifiers(NumLock, CapsLock, ScrollLock)
return nil return nil
} }