-
Notifications
You must be signed in to change notification settings - Fork 306
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
Add support for the use of CM108 for PTT on Mac #500
base: dev
Are you sure you want to change the base?
Conversation
Support for CM108-based PTT on Mac is provided using the hidapi library in the same way as on Windows. As such, the code changes are limited almost entirely to updated #if conditions, treating Windows and Mac in the same way.
The CMake changes are slightly complicated by the Windows build using a local copy of some hidapi files, for some reason, instead of using the hidapi library itself. The Mac version uses hidapi in the same way as other libraries. In the CMake files, it is unclear to me whether "elseif (NOT WIN32 AND NOT CYGWIN)" means the same thing as "elseif (APPLE)", so they are treated separately in order to avoid breaking other build types.
The generic config file can now be simplified slightly, since the section on using CM108 for PTT is now common to all of Linux, Windows and Mac.
Since building on Mac using Homebrew is straightforward, include this information in a new section of the README.
Flagging that this appears to be broken in Seqouia. When running
Similarly, running
I imagine this has to do with some increased hardening for access to physical raw devices present in Seqouia that isn't in prior versions. Sadly, I don't have any other device to test this. |
@mrnoisytiger Thanks for the heads-up. Unfortunately I don't have access to Seqouia to look at this right now. This is certainly not a real solution, but as a test, could you try running those commands (i.e. both the |
Unfortunately, it ends up in the same place with |
These changes implement support for PTT using CM108 on a Mac. A few notes:
The actual code is exactly the same as for Windows, using the hidapi API, so the changes are little more than updated #if conditions.
The CMake changes are slightly complicated by the Windows build using a local copy of some hidapi files, for some reason, instead of using the library itself. The Mac version uses hidapi in the same way as other libraries.
In the CMake files, it is unclear to me whether "elseif (NOT WIN32 AND NOT CYGWIN)" means the same thing as "elseif (APPLE)", so they are treated separately in order to avoid breaking other build types.
The generic config file has been simplified slightly, since the section on using CM108 for PTT is now common to all of Linux, Windows and Mac.
The README has been updated to include a build section for Mac.
These changes have been verified on macOS Ventura 13.6 (Apple M2 silicon) and macOS High Sierra 10.13.6 (Intel), as well as on Linux Mint 20.3 to verify that nothing was broken. I do not have a Windows system to test with.