Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Swift interoperability #19

Open
IgorMuzyka opened this issue Aug 8, 2018 · 4 comments
Open

Swift interoperability #19

IgorMuzyka opened this issue Aug 8, 2018 · 4 comments

Comments

@IgorMuzyka
Copy link

Yo hi. I'm in the process of developing my first mac app and I need to create a virtual HID keyboard so that I could send the events to the system but without intervening user input on the built-in keyboard.
I have little to no experience with C++. And I've done my app in Swift 4.2.
The question is: how do I use your library from Swift?
I've managed to google some techniques with wrapping C++ code with Objective-C++ files and creating a bridging header.
Even though I'm almost sure that this way would do this, but I'm kinda lost on how to do this quite right.
Would like to hear your guidance on how to approach this.
Or maybe you can provide a simple example and I'll learn from that and can cover the rest of calls/methods because I totally need this functionality.
The only other option besides your library is also done in C++, this one Karabiner-Elements.
To me, it seems that I have no other choice so I'll probably do this anyway, but with some help, I might be able to do this faster.

@IgorMuzyka
Copy link
Author

Also, interested to hear your opinion on using such tool?

@IgorMuzyka
Copy link
Author

@unbit

@IgorMuzyka
Copy link
Author

Just realized there is a mouse.swift file in the repo. I feel stupid, probably shouldn't code til 6 in the morning and research solutions for my problems.

@IgorMuzyka
Copy link
Author

IgorMuzyka commented Aug 10, 2018

Yo, I've kinda figured it out from mouse example. The only question I now have is how do I represent a composite report in Swift equivalently to union type in C? Is struct sufficient or is it not? @unbit

@IgorMuzyka IgorMuzyka reopened this Aug 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant