Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit c20a07b

Browse files
committed
Fix delay timers in keyboard
1 parent f4014fe commit c20a07b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/keyboard.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ func (k *Keyboard) modifierBitFromKeyName(key string) int64 {
240240

241241
func (k *Keyboard) press(key string, opts *KeyboardOptions) error {
242242
if opts.Delay != 0 {
243-
t := time.NewTimer(time.Duration(opts.Delay * time.Hour.Milliseconds()))
243+
t := time.NewTimer(time.Duration(opts.Delay) * time.Millisecond)
244244
select {
245245
case <-k.ctx.Done():
246246
t.Stop()
@@ -257,7 +257,7 @@ func (k *Keyboard) typ(text string, opts *KeyboardOptions) error {
257257
layout := keyboardlayout.GetKeyboardLayout(k.layoutName)
258258
for _, c := range text {
259259
if opts.Delay != 0 {
260-
t := time.NewTimer(time.Duration(opts.Delay * time.Hour.Milliseconds()))
260+
t := time.NewTimer(time.Duration(opts.Delay) * time.Millisecond)
261261
select {
262262
case <-k.ctx.Done():
263263
t.Stop()

0 commit comments

Comments
 (0)