sleep after not before keypresses
This commit is contained in:
parent
07d333b3eb
commit
68987774fd
1 changed files with 4 additions and 4 deletions
|
@ -282,30 +282,30 @@ func main() {
|
||||||
}
|
}
|
||||||
if s, ok := cutCmd(text, "key"); ok {
|
if s, ok := cutCmd(text, "key"); ok {
|
||||||
for _, field := range strings.Fields(s) {
|
for _, field := range strings.Fields(s) {
|
||||||
time.Sleep(keydelay)
|
|
||||||
if chord, err := parseChord(field); err == nil {
|
if chord, err := parseChord(field); err == nil {
|
||||||
chord.Press(keyboard)
|
chord.Press(keyboard)
|
||||||
} else {
|
} else {
|
||||||
warn(err.Error())
|
warn(err.Error())
|
||||||
}
|
}
|
||||||
|
time.Sleep(keydelay)
|
||||||
}
|
}
|
||||||
} else if s, ok := cutCmd(text, "keydown"); ok {
|
} else if s, ok := cutCmd(text, "keydown"); ok {
|
||||||
for _, field := range strings.Fields(s) {
|
for _, field := range strings.Fields(s) {
|
||||||
time.Sleep(keydelay)
|
|
||||||
if chord, err := parseChord(field); err == nil {
|
if chord, err := parseChord(field); err == nil {
|
||||||
chord.KeyDown(keyboard)
|
chord.KeyDown(keyboard)
|
||||||
} else {
|
} else {
|
||||||
warn(err.Error())
|
warn(err.Error())
|
||||||
}
|
}
|
||||||
|
time.Sleep(keydelay)
|
||||||
}
|
}
|
||||||
} else if s, ok := cutCmd(text, "keyup"); ok {
|
} else if s, ok := cutCmd(text, "keyup"); ok {
|
||||||
for _, field := range strings.Fields(s) {
|
for _, field := range strings.Fields(s) {
|
||||||
time.Sleep(keydelay)
|
|
||||||
if chord, err := parseChord(field); err == nil {
|
if chord, err := parseChord(field); err == nil {
|
||||||
chord.KeyUp(keyboard)
|
chord.KeyUp(keyboard)
|
||||||
} else {
|
} else {
|
||||||
warn(err.Error())
|
warn(err.Error())
|
||||||
}
|
}
|
||||||
|
time.Sleep(keydelay)
|
||||||
}
|
}
|
||||||
} else if s, ok := cutCmd(text, "keydelay"); ok {
|
} else if s, ok := cutCmd(text, "keydelay"); ok {
|
||||||
var d float64
|
var d float64
|
||||||
|
@ -317,13 +317,13 @@ func main() {
|
||||||
}
|
}
|
||||||
} else if s, ok := cutCmd(text, "type"); ok {
|
} else if s, ok := cutCmd(text, "type"); ok {
|
||||||
for _, r := range s {
|
for _, r := range s {
|
||||||
time.Sleep(typedelay)
|
|
||||||
if chord, ok := runeChords[unicode.ToLower(r)]; ok {
|
if chord, ok := runeChords[unicode.ToLower(r)]; ok {
|
||||||
if unicode.IsUpper(r) {
|
if unicode.IsUpper(r) {
|
||||||
chord.Shift = true
|
chord.Shift = true
|
||||||
}
|
}
|
||||||
chord.Press(keyboard)
|
chord.Press(keyboard)
|
||||||
}
|
}
|
||||||
|
time.Sleep(typedelay)
|
||||||
}
|
}
|
||||||
} else if s, ok := cutCmd(text, "typedelay"); ok {
|
} else if s, ok := cutCmd(text, "typedelay"); ok {
|
||||||
var d float64
|
var d float64
|
||||||
|
|
Loading…
Reference in a new issue