Closed odino closed 5 years ago
I try tomorrow... :) I have the same troble (Sorry if my english is bad)
No worries, your english is good!
Let me know if you have any news, it's such a weird error :-S
Hi I do build on my mac os x (10.11.2) it's ok. But cross compilation in linux isn't ok. Bugs probably come on C code in file keybd_darwin.go My skills is not good for find other way
In header keybd_darwin.go is compiled :
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Cocoa
#import <Foundation/Foundation.h>
CGEventRef Create(int k){
CGEventRef event = CGEventCreateKeyboardEvent (NULL, (CGKeyCode)k, true);
return event;
}
void KeyTap(CGEventRef event){
CGEventPost(kCGAnnotatedSessionEventTap, event);
CFRelease(event);
}
void AddActionKey(CGEventFlags type,CGEventRef event){
CGEventSetFlags(event, type);
}
It's possible same troble for gox
Actually I dont think it's C specific, as I can see it not compiling under some linux archs as well:
--> linux/386 error: exit status 2
Stderr: # github.com/micmonay/keybd_event
../../micmonay/keybd_event/keybd_event.go:22: undefined: initKeyBD
I have updated for your project touchy, because keys having not same name. I have testing your project on mac os x it is ok for me. But cross compilation I don't know why it is crashing. I find a solution... but I don't have a long experience in GOLANG
Hard ! I found and I have a first solution for linux x86 but no for darwin
env CGO_ENABLED=1 gox [project]
Trouble comes from cgo, some files are ignored. I don't know why exactly ^^
Oh that's nice! Let me try it!
Hi, for linux/arm of Debian 9
solution:
apt-get install gcc-arm-linux-gnueabi
env GOOS=linux GOARCH=arm CC=arm-linux-gnueabi-gcc CGO_ENABLED=1 go build ./main.go
Im using this library in a project but I cant seem to get it compiled for som platforms:
ie. this is the output using
gox
: