Coder Social home page Coder Social logo

Comments (8)

micmonay avatar micmonay commented on July 24, 2024

I try tomorrow... :)
I have the same troble
(Sorry if my english is bad)

from keybd_event.

odino avatar odino commented on July 24, 2024

No worries, your english is good!

Let me know if you have any news, it's such a weird error :-S

from keybd_event.

micmonay avatar micmonay commented on July 24, 2024

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

from keybd_event.

odino avatar odino commented on July 24, 2024

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

from keybd_event.

micmonay avatar micmonay commented on July 24, 2024

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

from keybd_event.

micmonay avatar micmonay commented on July 24, 2024

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 ^^

from keybd_event.

odino avatar odino commented on July 24, 2024

Oh that's nice! Let me try it!

from keybd_event.

TrashPony avatar TrashPony commented on July 24, 2024

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

from keybd_event.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.