Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation fails on macos-11 & macos-12 #44

Open
PrabhakarRai opened this issue Aug 24, 2022 · 3 comments
Open

Compilation fails on macos-11 & macos-12 #44

PrabhakarRai opened this issue Aug 24, 2022 · 3 comments

Comments

@PrabhakarRai
Copy link

The code works fine when complied on mac-os-10.15 but doing the same on mac-os-11 and mac-os-12 results in following errors.

keyboard_darwin.go:19:38: error: unknown type name 'CGEventRef'
keyboard_darwin.go:19:20: error: unknown type name 'CGEventFlags'; did you mean 'MPEventFlags'?
keyboard_darwin.go:16:14: error: use of undeclared identifier 'kCGAnnotatedSessionEventTap'
keyboard_darwin.go:15:14: error: unknown type name 'CGEventRef'
keyboard_darwin.go:13:9: error: use of undeclared identifier 'event'
keyboard_darwin.go:12:2: error: use of undeclared identifier 'CGEventRef'
keyboard_darwin.go:11:2: error: unknown type name 'CGEventRef'
keyboard_darwin.go:9:9: error: use of undeclared identifier 'event'
keyboard_darwin.go:8:2: error: use of undeclared identifier 'CGEventRef'
keyboard_darwin.go:7:2: error: unknown type name 'CGEventRef'
keyboard_darwin.go:28:21: could not determine kind of name for C.kCGEventFlagMaskShift
keyboard_darwin.go:33:21: could not determine kind of name for C.kCGEventFlagMaskSecondaryFn
keyboard_darwin.go:34:21: could not determine kind of name for C.kCGEventFlagMaskNumericPad
keyboard_darwin.go:35:21: could not determine kind of name for C.kCGEventFlagMaskNonCoalesced
keyboard_darwin.go:32:21: could not determine kind of name for C.kCGEventFlagMaskHelp
keyboard_darwin.go:29:21: could not determine kind of name for C.kCGEventFlagMaskControl
keyboard_darwin.go:31:21: could not determine kind of name for C.kCGEventFlagMaskCommand
keyboard_darwin.go:30:21: could not determine kind of name for C.kCGEventFlagMaskAlternate
keyboard_darwin.go:27:21: could not determine kind of name for C.kCGEventFlagMaskAlphaShift
keyboard_darwin.go:107:2: could not determine kind of name for C.KeyTap
keyboard_darwin.go:110:13: could not determine kind of name for C.CreateUp
keyboard_darwin.go:85:15: could not determine kind of name for C.CreateDown
keyboard_darwin.go:69:18: could not determine kind of name for C.CGEventRef
keyboard_darwin.go:73:2: could not determine kind of name for C.AddActionKey
@monolife
Copy link

monolife commented Jan 19, 2023

Changing the import from #import <Foundation/Foundation.h to #import <Cocoa/Cocoa.h> in the cgo portion at the top of keyboard_darwin.go seems to work. I guess Apple reworked the imports in Cocoa

@TangMonk
Copy link

Changing the import from #import <Foundation/Foundation.h to #import <Cocoa/Cocoa.h> in the cgo portion at the top of keyboard_darwin.go seems to work. I guess Apple reworked the imports in Cocoa

wow, it works

@tmc
Copy link

tmc commented Jul 2, 2023

@micmonay can you get this refreshed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants