robotgo icon indicating copy to clipboard operation
robotgo copied to clipboard

mac os Failed to create apple event port.

Open xiusin opened this issue 4 years ago • 5 comments

go version: go version go1.14.3 darwin/amd64

macos: 10.15.7

hook_run [1270]: Failed to create event port! Failed to create apple event port.

xiusin avatar Nov 24 '20 12:11 xiusin

Have you given permission to the Terminal app for Screen Recording and Accessibility under: System Preferences > Security and Privacy > Privacy > Accessibility (assuming that your are running the example program from the Terminal)?

vcaesar avatar Nov 26 '20 16:11 vcaesar

@vcaesar Thank you. It's working,but exec the keyTap("c", "cmd") will get a panic

xiusin avatar Nov 30 '20 02:11 xiusin

@vcaesar

SIGILL: illegal instruction
PC=0x7fff6dec28f1 m=4 sigcode=1

goroutine 0 [idle]:
runtime: unknown pc 0x7fff6dec28f1
stack: frame={sp:0x70000ab66c40, fp:0x0} stack=[0x70000aae7350,0x70000ab66f50)
000070000ab66b40:  000070000ab66d58  0000000006ad4250
000070000ab66b50:  0000000000000000  d827e7b9838e00dd
000070000ab66b60:  000070000ab669b0  000070000ab66c10
000070000ab66b70:  00007fff6def4165  00007fff6def70ee
000070000ab66b80:  00007fff6def2330  0000000000000000
000070000ab66b90:  0000000000000000  0000000000000000
000070000ab66ba0:  0000000000000000  0000000000000000
000070000ab66bb0:  0000000000000000  0000000000000000
000070000ab66bc0:  0000000000000000  0000000000000000
000070000ab66bd0:  0000000000000000  0000000000000000
000070000ab66be0:  0000000000000000  0000000000000000
000070000ab66bf0:  0000000000000000  0000000006ad3b20
000070000ab66c00:  0000003000000010  000070000ab66c40
000070000ab66c10:  000070000ab66b40  d827e7b9838e00dd
000070000ab66c20:  0000000006ad4250  000070000ab66d58
000070000ab66c30:  000070000ab66c50  00007fff6dec28ea
000070000ab66c40: <0000000006ad4250  0000000000000000
000070000ab66c50:  000070000ab66c60  00007fff6dec2886
000070000ab66c60:  000070000ab66d10  00007fff32a90dd2
000070000ab66c70:  0000000000000000  0000000000000000
000070000ab66c80:  0000000000000000  0000000000000000
000070000ab66c90:  0000000000000000  0000000000000000
000070000ab66ca0:  0000000000000000  0000000000000000
000070000ab66cb0:  0000000000000000  0000000000000000
000070000ab66cc0:  0000000000000003  0000000000000000
000070000ab66cd0:  00000000000007d8  0000000000000009
000070000ab66ce0:  0000000000000001  0000000000000000
000070000ab66cf0:  0000000006b6c370  0000000006b6eeb0
000070000ab66d00:  000070000ab66d58  000000000000011b
000070000ab66d10:  000070000ab66d40  00007fff32a935c8
000070000ab66d20:  0000000000000000  00007fff8b407028
000070000ab66d30:  0000000006b6c370  00007fff8b405b68
runtime: unknown pc 0x7fff6dec28f1
stack: frame={sp:0x70000ab66c40, fp:0x0} stack=[0x70000aae7350,0x70000ab66f50)
000070000ab66b40:  000070000ab66d58  0000000006ad4250
000070000ab66b50:  0000000000000000  d827e7b9838e00dd
000070000ab66b60:  000070000ab669b0  000070000ab66c10
000070000ab66b70:  00007fff6def4165  00007fff6def70ee
000070000ab66b80:  00007fff6def2330  0000000000000000
000070000ab66b90:  0000000000000000  0000000000000000
000070000ab66ba0:  0000000000000000  0000000000000000
000070000ab66bb0:  0000000000000000  0000000000000000
000070000ab66bc0:  0000000000000000  0000000000000000
000070000ab66bd0:  0000000000000000  0000000000000000
000070000ab66be0:  0000000000000000  0000000000000000
000070000ab66bf0:  0000000000000000  0000000006ad3b20
000070000ab66c00:  0000003000000010  000070000ab66c40
000070000ab66c10:  000070000ab66b40  d827e7b9838e00dd
000070000ab66c20:  0000000006ad4250  000070000ab66d58
000070000ab66c30:  000070000ab66c50  00007fff6dec28ea
000070000ab66c40: <0000000006ad4250  0000000000000000
000070000ab66c50:  000070000ab66c60  00007fff6dec2886
000070000ab66c60:  000070000ab66d10  00007fff32a90dd2
000070000ab66c70:  0000000000000000  0000000000000000
000070000ab66c80:  0000000000000000  0000000000000000
000070000ab66c90:  0000000000000000  0000000000000000
000070000ab66ca0:  0000000000000000  0000000000000000
000070000ab66cb0:  0000000000000000  0000000000000000
000070000ab66cc0:  0000000000000003  0000000000000000
000070000ab66cd0:  00000000000007d8  0000000000000009
000070000ab66ce0:  0000000000000001  0000000000000000
000070000ab66cf0:  0000000006b6c370  0000000006b6eeb0
000070000ab66d00:  000070000ab66d58  000000000000011b
000070000ab66d10:  000070000ab66d40  00007fff32a935c8
000070000ab66d20:  0000000000000000  00007fff8b407028
000070000ab66d30:  0000000006b6c370  00007fff8b405b68

xiusin avatar Dec 13 '20 13:12 xiusin

I will test it.

vcaesar avatar Jan 23 '21 15:01 vcaesar

I ran into the same issue.here is my environment

go version: go1.17.6 macos: 12.3 Mac OS Monterey

below is the sample code. it just prints blow in the console. GoLang & Terminal App are allowed for Screen Recording and Accessibility

robotgo version is:  v1.00.0.1189, MT. Baker!
ver := robotgo.GetVersion()
	fmt.Println("robotgo version is: ", ver)
	ok := hook.AddEvent("w")
	if ok {
		fmt.Println("add events...")
	} else {
		fmt.Println("failed to add event")
	}
	evChan := hook.Start()
	defer hook.End()

	for ev := range evChan {
		fmt.Println("hook: ", ev)
	}

kcmvp avatar Mar 25 '22 10:03 kcmvp