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

Commit

Permalink
Fix key tap not firing
Browse files Browse the repository at this point in the history
  • Loading branch information
echocrow committed May 31, 2022
1 parent 0791366 commit 18bb35c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/enter/enter_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import "C"

import (
"fmt"
"time"
)

const returnKey = C.kVK_Return
Expand All @@ -32,6 +33,7 @@ func tap(key int) error {

loc := C.CGEventTapLocation(C.kCGHIDEventTap)
C.CGEventPost(loc, down)
time.Sleep(time.Millisecond)
C.CGEventPost(loc, up)

return nil
Expand Down

0 comments on commit 18bb35c

Please sign in to comment.