-
Notifications
You must be signed in to change notification settings - Fork 938
Open
Description
Would the KeyToggle function args parameters be better changed to ...string, i.e
func robotgo.KeyToggle(key string, args ...string) error
// was func robotgo.KeyToggle(key string, args ...interface{}) error
e.g. See the sample code below, where to build a slice of strings, I have to declare the modifiers as []any{} when I would prefer to declare []string{} which would match the (intended) parameters better.
func press_release(key keyJSON) {
modifiers := []any{}
state := "up"
if key.Press {
state = "down"
}
modifiers = append(modifiers, state)
if key.Shift {
modifiers = append(modifiers, "shift")
}
if key.Ctrl {
modifiers = append(modifiers, "ctrl")
}
if key.Alt {
modifiers = append(modifiers, "alt")
}
robotgo.KeyToggle(key.Key, modifiers...)
}
Metadata
Metadata
Assignees
Labels
No labels