Skip to content

Commit

Permalink
Fix autotype on kde
Browse files Browse the repository at this point in the history
  • Loading branch information
quexten committed Jan 23, 2024
1 parent def7f7a commit 01ecb54
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autotype/libportalautotype.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ func TypeString(textToType string) {
result := message.Body[1].(map[string]dbus.Variant)
resultSessionHandle := result["session_handle"]
sessionHandle = dbus.ObjectPath(resultSessionHandle.String()[1 : len(resultSessionHandle.String())-1])
res := obj.Call("org.freedesktop.portal.RemoteDesktop.SelectDevices", 0, sessionHandle, map[string]dbus.Variant{})
res := obj.Call("org.freedesktop.portal.RemoteDesktop.SelectDevices", 0, sessionHandle, map[string]dbus.Variant{
"types": dbus.MakeVariant(uint32(1)),
})
if res.Err != nil {
log.Error("Error selecting devices: %s", res.Err.Error())
}
Expand All @@ -64,7 +66,7 @@ func TypeString(textToType string) {
} else if state == 2 {
log.Info("Performing Typing")
state = 3
time.Sleep(200 * time.Millisecond)
time.Sleep(1000 * time.Millisecond)
for _, char := range textToType {
if char == '\t' {
obj.Call("org.freedesktop.portal.RemoteDesktop.NotifyKeyboardKeycode", 0, sessionHandle, map[string]dbus.Variant{}, 15, uint32(1))
Expand Down

0 comments on commit 01ecb54

Please sign in to comment.