cguckes / ksp-chroma

Allows Kerbal Space Program to modify the lighting on your Razer Black Widow Chroma Keyboard.
GNU General Public License v3.0
18 stars 10 forks source link

Add support for Logitech products (G910) #1

Closed kaeltis closed 8 years ago

kaeltis commented 8 years ago

Hey, could you please add support for Logitech keyboards like the G910, would be really awesome :)

The LED illumination SDK is available at http://gaming.logitech.com/en-us/developers There is already everything included to use it with C# + a quite extensive documentation, I can test the builds for you and provide feedback.

If it doesn't work that way I could try forking your code and overwrite it with an implementation for Logitech Keyboards so that could later be merged again (just never developed a plugin for KSP before).

cguckes commented 8 years ago

I would be happy to do that, but I'm not in the posession of that keyboard, so testing that is not that satisfying ;-) I'd say send me one, but that would be quite a lot of money to pay for a mod for a 25$ game ^^. Also I could try to implement it and have you come by with your keyboard one afternoon to test it, since you live in Mannheim. ;-) Debugging by sending you the code would be rather tedious, I fear. If you want to implement it yourself, I'd be happy to include your code in the mod, if you produce a pull request. I disconnected most of the keyboard related code from the color scheme, so basically you just need to implement the DataDrain interface similar to the way ColoreDrain (Colore is the library used by Razer) does. Let me know which solution you like best...

kaeltis commented 8 years ago

I'll try to implement it, haven't used C# for quite some time, but I like a small challenge once in a while :D

kaeltis commented 8 years ago

Well, on my fork https://github.com/Kaeltis/ksp-chroma I made it work with the logitech API, but I had to strip all Colore references, KSP refused to load it otherwise for some reason :( are you still able to merge this? (also, ReSharper did some "optimizations" of the code, it's working, just ignore it if you don't like it xD)

Only problem I'm seeing in the log:

NullReferenceException: Object reference not set to an instance of an object
  at KSP_Chroma_Control.SceneManagers.VABSceneManager.updatePlacementState () [0x00000] in <filename unknown>:0 

  at KSP_Chroma_Control.SceneManagers.VABSceneManager.update () [0x00000] in <filename unknown>:0 

  at KSP_Chroma_Control.SceneManagers.VABSceneManager.getScheme () [0x00000] in <filename unknown>:0 

  at KSP_Chroma_Control.KSPChromaPlugin.FixedUpdate () [0x00000] in <filename unknown>:0 

(Filename:  Line: -1)

this doesn't seem to affect anything though, it's perfectly working.

kaeltis commented 8 years ago

Crap, didn't want to close that.

cguckes commented 8 years ago

I assume you used the original Colore library? I modified it to work with unity again because the original authors somehow broke support for it. I think I messed up the interface because the Unity => Razer key translation happens outside. If I move that into ColoreDrain we should be able to either support both keyboards at the same time or provide two different build targets, one for each keyboard. Do you want to create a pull request or do you want developer access? Basically I'm asking, if you want to help maintain the project or just give me code this one time ;-)

kaeltis commented 8 years ago

I used the library from the packages folder, dunno if it's the right one :D If you'd like I can help you from time to time with updates (especially with porting it to logitech), however my knowledge of C# and KSP / Unity Modding in general is kinda limited, I mostly had to work with Java in the last couple of years :hankey:

But if you can give me developer access and fix the interface with the key translation, moving it to ColoreDrain, i'll merge my stuff into the code and try to help as good as I can :)

cguckes commented 8 years ago

If this is turning into a chat, let's move this to where it belongs ^^ https://gitter.im/cguckes/ksp-chroma