Jump to content
Corsair Community

(Unofficial) Linux / OSX Driver


MSC

Recommended Posts

GitHub: https://github.com/ccMSC/ckb

 

Here's a short sample video:

 

I'm building a driver for the RGB keyboards so that us Linux users don't miss out on the cool features. Many thanks to CalcProgrammer1 and others (link to his thread here) for decoding the LED messages - wouldn't have gotten this far without them. I really liked the music visualizer and wanted to restructure it into more of a generic driver, so here's my attempt. :biggrin:

 

It's very incomplete at the moment, needs more fine-tuning and it's still missing major features like key rebinding or the use of the G-keys, but if anyone else out there uses one of these keyboards with Linux I'd love some testing/feedback. It *should* work with the K70 as well as the K95, although I only have a K95 so I can't test the former. Might be possible to run it under OSX as well. I'll keep the GitHub posted as I make progress.

 

 

Hey Dude, nice work. Does is work for mac?

Link to comment
Share on other sites

  • Replies 824
  • Created
  • Last Reply

Top Posters In This Topic

Hello

Love your work, thanks!

 

FYI: The installation instruction work great on my Mac OS X 10.10.1

 

Some have some minor issues to report:

1. "Show mute indicator" has the opposite function but works

2. Under settings "Re-scan" breaks the app

3. When opening "Microsoft Remote Desktop", all modifier keys stops working eg. alt, ctrl ...., if you can find a solution I'm more than happy.

4. "echo mode 2 switch > /tmp/ckb1/cmd", does not seams to switch mode or am I missing something

 

Also I would like to donate :)

Edited by Dag Hultgren
One more issue
Link to comment
Share on other sites

Hey Dude, nice work. Does is work for mac?

 

Yes - there are Mac instructions on the GitHub page.

 

Hello

Love your work, thanks!

 

FYI: The installation instruction work great on my Mac OS X 10.10.1

 

Some have some minor issues to report:

1. "Show mute indicator" has the opposite function but works

2. Under settings "Re-scan" breaks the app

3. When opening "Microsoft Remote Desktop", all modifier keys stops working eg. alt, ctrl ...., if you can find a solution I'm more than happy.

4. "echo mode 2 switch > /tmp/ckb1/cmd", does not seams to switch mode or am I missing something

 

Also I would like to donate :)

 

1. It's supposed to turn the light ON when mute is enabled, and OFF when it's disabled. It's doing the opposite for you?

2. You're right. Should be fixed now.

3. I'm not sure about this one. I've made some changes to the OSX code that may solve it, but you'll have to test it. If not I'll try to download the program and see what's going on.

4. Are you running ckb at the same time, or just the daemon? If you're running ckb, most of the daemon commands won't work because ckb will immediately overwrite them. Using the terminal commands together with the UI doesn't work very well at the moment.

 

I fixed the problem with Cmd+Option+Esc on OSX...I think. I also fixed a problem where the keyboard wouldn't wake the display from sleep (might have allowed the computer to sleep even while the keyboard was in use, too). Apple's input programming is extremely strange. Let me know if you find any other weird issues.

 

I've added support for the K65 RGB keyboard, thanks to input from a helpful user. It's not totally complete yet, but if anyone else has a K65 keyboard it should be recognized now. I've also finally finished support for multi-color animations, so you can create rainbow gradients just like in CUE now. I thought this would be a nice occasion for a new video, since I haven't posted one since the early testing phase:

 

[ame]

[/ame]

 

I'll be writing documentation for the animation API over the next few days so anyone interested in creating their own can do so.

 

Donation links are up on the GitHub page, so you guys can make good on your offers to buy me a drink if you so desire. Totally voluntary, of course. :) But most of all I just wanted to say thanks for your support and thanks for continuing to test this driver. The feedback has been immensely helpful and I wouldn't have gotten this far without all of you.

Link to comment
Share on other sites

 

1. It's supposed to turn the light ON when mute is enabled, and OFF when it's disabled. It's doing the opposite for you?

2. You're right. Should be fixed now.

3. I'm not sure about this one. I've made some changes to the OSX code that may solve it, but you'll have to test it. If not I'll try to download the program and see what's going on.

4. Are you running ckb at the same time, or just the daemon? If you're running ckb, most of the daemon commands won't work because ckb will immediately overwrite them. Using the terminal commands together with the UI doesn't work very well at the moment.

 

I fixed the problem with Cmd+Option+Esc on OSX...I think. I also fixed a problem where the keyboard wouldn't wake the display from sleep (might have allowed the computer to sleep even while the keyboard was in use, too). Apple's input programming is extremely strange. Let me know if you find any other weird issues.

 

1. YES, opposite

2. Tested and OK

3. My misstake "Microsoft Remote Desktop" is working now, BUT if the CBK app is running it does not work

4. Yes I was, but can't get the M1-3 to work with only the daemon running

 

The problem with Cmd+Option+Esc on OSX

:biggrin: Tested and OK

Edited by Dag Hultgren
Clarify
Link to comment
Share on other sites

Amazing bit of coding mate, spent most of my work day scanning through the code and it's top quality. I'd love to help anywhere I can.

 

One thing I was going to suggest was writing a binding for the animation API to Ruby or Python. Happy to contribute where I can for that.

 

I was also thinking of providing builds for OS X to save some people who aren't so familiar the hassle of the set up.

 

Again, awesome work!

Link to comment
Share on other sites

1. YES, opposite

2. Tested and OK

3. My misstake "Microsoft Remote Desktop" is working now, BUT if the CBK app is running it does not work

4. Yes I was, but can't get the M1-3 to work with only the daemon running

 

The problem with Cmd+Option+Esc on OSX

:biggrin: Tested and OK

 

Ok, no idea what to do about the mute button...I might just add an option to reverse the behavior so it works for you, haha. I'll take a look at the Remote Desktop program and see if I can figure out what's going on.

 

As for #4, that's correct - the limitation for right now is that the daemon commands don't work well when ckb is running, but the top row of buttons (M1-M3, Brightness, Win Lock) don't work without it. In a future version they'll be better integrated so that you can use the daemon commands even when ckb is running.

 

Amazing bit of coding mate, spent most of my work day scanning through the code and it's top quality. I'd love to help anywhere I can.

 

One thing I was going to suggest was writing a binding for the animation API to Ruby or Python. Happy to contribute where I can for that.

 

I was also thinking of providing builds for OS X to save some people who aren't so familiar the hassle of the set up.

 

Again, awesome work!

 

If you could provide binaries for OSX that would be very helpful, actually. :) I'd gladly link to them on the GitHub page.

 

I'd agree Python or Ruby scripting would be great (I've also gotten suggestions for JavaScript and LUA - Corsair says they're planning to implement LUA scripting in their own app, but I have no idea when that will be finished). Ideally, I'd like to have a "create custom animation" button that opens up IDLE or some other IDE within the app, and allows you to save the animation as part of the profile. It would be a lot more portable than pre-compiled C programs, especially if I ever add the ability to export profiles. I don't believe OSX comes with Python pre-installed, so I'd probably have to bundle it, but other than that I don't think it should be too difficult

 

On an unrelated note, if anybody out there has a *non-RGB* K65/K70/K95, I'm looking to add support for those devices as well. I have somebody currently testing the K70, but they won't have access to it for a while, so if anybody else has one of those models and is interested in seeing support for it, feel free to contact me.

Link to comment
Share on other sites

If you could provide binaries for OSX that would be very helpful, actually. :) I'd gladly link to them on the GitHub page.

 

I'd agree Python or Ruby scripting would be great (I've also gotten suggestions for JavaScript and LUA - Corsair says they're planning to implement LUA scripting in their own app, but I have no idea when that will be finished). Ideally, I'd like to have a "create custom animation" button that opens up IDLE or some other IDE within the app, and allows you to save the animation as part of the profile. It would be a lot more portable than pre-compiled C programs, especially if I ever add the ability to export profiles. I don't believe OSX comes with Python pre-installed, so I'd probably have to bundle it, but other than that I don't think it should be too difficult

 

Great, I'll post links here for now :)

 

AFAIK, recent versions of OS X should come with Python and Ruby pre-installed. As of 10.10, it's Python 2.6 and Ruby 2.1.

 

I'll see if I can get something going on the animation side tonight :)

Link to comment
Share on other sites

Hey MSC:

Thank you very much for graciously providing such an awesome workaround for the Corsair RGB keyboards. I purchased the K65 keyboard today and followed your instructions to operate your app in OSX, but unfortunately I've run into the issue of not being able to use the Cmd, Ctrl, and Alt keys to force quit applications. Could you please advise me on how to resolve the issue?

 

I'd appreciate all the help & feedback immensely! The keyboard is absolutely gorgeous and I really want to make good use out of it with Mac OSX. Thank you kindly in advance—

Edited by nightwing10
Link to comment
Share on other sites

Great, I'll post links here for now :)

 

AFAIK, recent versions of OS X should come with Python and Ruby pre-installed. As of 10.10, it's Python 2.6 and Ruby 2.1.

 

I'll see if I can get something going on the animation side tonight :)

 

Ok, good to hear. Let me know what you come up with. :)

 

Hey MSC:

Thank you very much for graciously providing such an awesome workaround for the Corsair RGB keyboards. I purchased the K65 keyboard today and followed your instructions to operate your app in OSX, but unfortunately I've run into the issue of not being able to use the Cmd, Ctrl, and Alt keys to force quit applications. Could you please advise me on how to resolve the issue?

 

I'd appreciate all the help & feedback immensely! The keyboard is absolutely gorgeous and I really want to make good use out of it with Mac OSX. Thank you kindly in advance—

 

Which version of OSX are you running (Yosemite, Mavericks, ...)? Are you referring to the Cmd+Option+Esc shortcut or some other combination?

Link to comment
Share on other sites

I'm using Yosemite (10.10) & yes, the Cmd + Option + Esc combo. Using other Cmd related shortcuts aren't working for apps like Chrome & Photoshop :(

 

Try downloading this software here: http://manytricks.com/keycodes/

Open the app and check the "Log key up events and modifier changes" box. Now *without* the daemon running, click inside the window and press the Cmd key. Move the window to the side and start the daemon. Once it's up and running, click on the Key Codes window again, and press the Cmd key again. It should look something like this:

qpctK57.png

 

Take a screenshot of the window and post it here. Hopefully that will tell me what's happening.

 

Here is the fist build as a package installer. At the moment you'll need to run ckb-daemon manually. I can provide some instructions if people want to set it up to run automatically on boot if needed.

 

ckb v0.0.24 / Mac OS X 10.9+

https://mega.co.nz/#!yp1nnbQC!fOt4aqdZsfq35j1BbE8JVQcGQ2gvPBcI-U72B_fi3bM

 

Default install location is /Applications/CKB.

 

Installer's looking good. I got this set up in a test environment but unfortunately, ckb wouldn't run. Here's the error it threw when I launched it via terminal:

dyld: Library not loaded: /Applications/Qt/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
 Referenced from: /Applications/CKB/ckb.app/Contents/MacOS/ckb
 Reason: image not found
Trace/BPT trap: 5

 

So it seems like it's looking for the Qt installation in a fixed spot and it's not there. Is there a way to bundle it?

 

I also notice ckb.app is missing its icon...that's probably my fault, Qt stopped packaging it for no apparent reason but I thought my computer was just being insane. Guess it's not just me. Grr.

 

Also, as a heads up, I'm going to try packaging ckb-daemon and ckb-animations inside of ckb.app, so then there's no need to create a separate directory for them. Should help the app feel a little more Mac-friendly.

Link to comment
Share on other sites

Installer's looking good. I got this set up in a test environment but unfortunately, ckb wouldn't run. Here's the error it threw when I launched it via terminal:

 

dyld: Library not loaded: /Applications/Qt/5.4/clang_64/lib/QtWidgets.framework/Versions/5/QtWidgets
 Referenced from: /Applications/CKB/ckb.app/Contents/MacOS/ckb
 Reason: image not found
Trace/BPT trap: 5

 

So it seems like it's looking for the Qt installation in a fixed spot and it's not there. Is there a way to bundle it?

 

I also notice ckb.app is missing its icon...that's probably my fault, Qt stopped packaging it for no apparent reason but I thought my computer was just being insane. Guess it's not just me. Grr.

 

Also, as a heads up, I'm going to try packaging ckb-daemon and ckb-animations inside of ckb.app, so then there's no need to create a separate directory for them. Should help the app feel a little more Mac-friendly.

 

Ah I had a suspicion that it'd retain paths. I'll see if I can sort that out - it's most likely because I moved the build into Xcode.

 

And yep I was going to suggest having the daemon embedded and maybe have a start/stop button?

Link to comment
Share on other sites

Hi MSC,

nice work and good programs!

I startet a similarly project on github some weeks ago. I will try to upload some videos and tutorials in the next days. It's current version is now more a beta then an alpha version.

 

Maybe you have time to give it a short look:

https://github.com/VanFanelia/CorsairColorManager

 

I try an other concept to enable everybody to write some cool effects without deep programming skills.

 

Maybe we can learn some stuff from each other :)

 

greetings,

Van

Link to comment
Share on other sites

Ah I had a suspicion that it'd retain paths. I'll see if I can sort that out - it's most likely because I moved the build into Xcode.

 

And yep I was going to suggest having the daemon embedded and maybe have a start/stop button?

 

A start/stop button sounds like a good idea, yeah. The binaries should all be moved inside ckb.app now, let me know if you have any troubles with it.

 

I did find this regarding deploying Qt apps on OSX: http://qt-project.org/doc/qt-4.8/deployment-mac.html#the-mac-deployment-tool

...but it says nothing about how to actually use it. Hopefully one of us can figure it out, haha

 

Hi MSC,

nice work and good programs!

I startet a similarly project on github some weeks ago. I will try to upload some videos and tutorials in the next days. It's current version is now more a beta then an alpha version.

 

Maybe you have time to give it a short look:

https://github.com/VanFanelia/CorsairColorManager

 

I try an other concept to enable everybody to write some cool effects without deep programming skills.

 

Maybe we can learn some stuff from each other :)

 

greetings,

Van

 

Nice little program. I like the idea of putting color changes into JSON, seems very handy :)

Link to comment
Share on other sites

A start/stop button sounds like a good idea, yeah. The binaries should all be moved inside ckb.app now, let me know if you have any troubles with it.

 

I did find this regarding deploying Qt apps on OSX: http://qt-project.org/doc/qt-4.8/deployment-mac.html#the-mac-deployment-tool

...but it says nothing about how to actually use it. Hopefully one of us can figure it out, haha.

 

Sorry for the lack of updates, work work!

 

Anyhoo, I managed to figure out the QT Mac deploy tool and I've built the latest version of CKB for Mac:

 

http://mbx.cm/t/_guh4 (d45ac7d)

 

I've decided to just package the app bundle into a .dmg file for now as it's much simpler and quicker with MSC popping everything into the one app bundle. I'll soon be adding a launch daemon to my release so you can have it start up in the background at logon - the installer will return then. Let me know if there are any more issues.

 

Remember: ckb-daemon is *inside* the app package (right-click on CKB.app, click show package contents) at CKB.app/Contents/Resources/ckb-daemon.

Link to comment
Share on other sites

Sorry for the lack of updates, work work!

 

Anyhoo, I managed to figure out the QT Mac deploy tool and I've built the latest version of CKB for Mac:

 

http://mbx.cm/t/_guh4 (d45ac7d)

 

I've decided to just package the app bundle into a .dmg file for now as it's much simpler and quicker with MSC popping everything into the one app bundle. I'll soon be adding a launch daemon to my release so you can have it start up in the background at logon - the installer will return then. Let me know if there are any more issues.

 

Remember: ckb-daemon is *inside* the app package (right-click on CKB.app, click show package contents) at CKB.app/Contents/Resources/ckb-daemon.

 

Nice, it's working for me now :D

 

Do you have a GitHub account? If so I could give you write access to the project so that you can add the binary links yourself (probably shouldn't place them directly in the repository, GitHub doesn't seem to like that) and add the launchd service when it's done.

 

Edit: Actually, I just noticed, ckb says "no animations detected", despite the fact that the path seems to be correct and an "ls -l" shows they're all marked as executable. Does that happen to you? Maybe I need to make it ignore the executable bit and just add any file that it finds at that path.

 

Edit 2: Wait, no, actually the problem is that all of the command-line programs (including the daemon and the animations) are still not finding the Qt framework, even though it's working correctly for ckb.app. So I'm guessing you'll need to use the deploy tool on all of them individually?

Edited by MSC
Link to comment
Share on other sites

I cannot, for the life of me, figure out how to copy settings back and forth between two macs. I have moved the com.ckb.ckb.plist file from ~/Library/Preferences/ and even doublechecked the md5 to make sure they were identical but to no avail. They each just see whatever settings I have created on that machine. Any advice?

 

That aside, the new customizations to the animations are phenomenal! I love the flexibility!

 

Is there any plan to include key repeat? Like if I hold down e, it makes eeeeeeeeee? I know this works with backspace, but it's rather slow even there. If not, no big deal! Thanks again!

Link to comment
Share on other sites

Did you make sure to close ckb on both computers before copying? It only loads settings when it starts and only saves them when it stops, so if you tried to copy while it was running it wouldn't load them. If that's still not working for you then I'll try to make an import/export function.

 

The driver should support key repeats already (though they're slower than they should be, as you noticed - this is on my list of things to fix soon-ish). I think what you're seeing is an OSX feature that disables it: http://www.tekrevue.com/tip/how-to-disable-the-character-accent-menu-in-os-x-mountain-lion/

Try that and see if it does what you expect.

Link to comment
Share on other sites

I cannot, for the life of me, figure out how to copy settings back and forth between two macs. I have moved the com.ckb.ckb.plist file from ~/Library/Preferences/ and even doublechecked the md5 to make sure they were identical but to no avail. They each just see whatever settings I have created on that machine. Any advice?

 

That aside, the new customizations to the animations are phenomenal! I love the flexibility!

 

Is there any plan to include key repeat? Like if I hold down e, it makes eeeeeeeeee? I know this works with backspace, but it's rather slow even there. If not, no big deal! Thanks again!

 

Check ~/Library/Preferences - it might be storing separate settings in there.

 

As for key-repeat, do you have the character replacement thing enabled? So if you press and hold a key, it brings up different character replacements? If so, I don't think key-repeat will work.

 

Nice, it's working for me now :D

 

Do you have a GitHub account? If so I could give you write access to the project so that you can add the binary links yourself (probably shouldn't place them directly in the repository, GitHub doesn't seem to like that) and add the launchd service when it's done.

 

Edit: Actually, I just noticed, ckb says "no animations detected", despite the fact that the path seems to be correct and an "ls -l" shows they're all marked as executable. Does that happen to you? Maybe I need to make it ignore the executable bit and just add any file that it finds at that path.

 

Edit 2: Wait, no, actually the problem is that all of the command-line programs (including the daemon and the animations) are still not finding the Qt framework, even though it's working correctly for ckb.app. So I'm guessing you'll need to use the deploy tool on all of them individually?

 

I do have a Github account, it's the same as this: xiy. Would be a lot easier for people to keep up with releases then I guess!

 

As for the lib things, I think might have a solution. The deploy app doesn't seem to link the embedded binaries to the libs the same way as for the app bundle (so the ckb GUI). I'll see if I can get that working though.

Link to comment
Share on other sites

Okay, I added you as a collaborator for the repository. I also made a new section in the readme for the OSX binaries, so you can go ahead and update that whenever you have a new one :)

 

IIRC there's a way to specify the location of Qt frameworks at compile-time, so if nothing else works you could probably hard-code them to point to /Applications/ckb.app.

Link to comment
Share on other sites

I tried shutting everything down, then copying the com.ckb.ckb.plist from one installation to another and still no luck. I even tried shutting it all down, then deleting com.ckb.ckb.plist from ~/Library/Preferences/ and it still remembers the settings that were set up before... I don't know if that's the file where things are saved, it seems to have little to no impact on the current profiles/animations.
Link to comment
Share on other sites

Weird. That should definitely cause it to forget everything. Only other thing I can think of is if the file is somehow being stored in /Library/Preferences instead of ~/Library/Preferences, so I guess you could check there. Beyond that I'm out of ideas.
Link to comment
Share on other sites

Hmm.... I checked there as well to no avail. I'll keep looking and let you know if I find anything else.

 

Edit:

 

Success!!! I figured it out. With Qt on a Mac os greater than 10.3, it uses cached preferences. So after you quit ckb, and copy over your prefs from another location, make sure you run this in the terminal:

 

killall -u yourusername cfprefsd

 

Edit #2:

 

Is anyone else having trouble when right-clicking on an existing mode and trying to duplicate it? When I try to, it just creates a new blank mode for me.

Edited by CorpNewt
Link to comment
Share on other sites

Huh...I had no idea it did that. Glad you got it solved!

 

You're right about Duplicate Mode not working. I'm in the process of rewriting the profile/mode management code so I should have this fixed in a few days.

Link to comment
Share on other sites


×
×
  • Create New...