Jump to content
Corsair Community

[WIP] GTA V dynamic lighting


Recommended Posts

  • Replies 67
  • Created
  • Last Reply
Good to hear that it's working on the K95! And you are correct, GTAV is deciding what buttons to light up but you could modify my source code to map different keys to different lights (if you're comfortable modifying C++ and have Visual Studio 2013 installed)

 

For example, if you want the number keys to flash when the cops come after you you can add another for loop in the LogiLedSetLightingFromBitmap function.

 

for (unsigned int i = 22; i < 32; ++i)
	CorsairRGB::Keyboard::SetKey(g_CorsairKeyFromLogi[i], bitmap[((i - 21) * LOGI_LED_BITMAP_BYTES_PER_KEY)], bitmap[((i - 21) * LOGI_LED_BITMAP_BYTES_PER_KEY) + 1], bitmap[((i - 21) * LOGI_LED_BITMAP_BYTES_PER_KEY) + 2]);

 

This code will go from Key ID 22 to Key 32 (1-0 number keys) and set their lighting state to the F1-F12 keys.

 

You can change the colour of any keys on the keyboard usiung a similar method to how i do the mouse lighting as that grabs colour info from Escape, F1 and F7 keys and maps them to the mouse lights. This can easily be done for other keys

 

CorsairRGB::Keyboard::SetKey(CorsairRGB::Keys::space, bitmap[(7 * LOGI_LED_BITMAP_BYTES_PER_KEY)], bitmap[(7 * LOGI_LED_BITMAP_BYTES_PER_KEY) + 1], bitmap[(7 * LOGI_LED_BITMAP_BYTES_PER_KEY) + 2]);

 

That line will maps the space bar to the colour of the F7 key. The 7 in bitmap[(7 refers to the logitech Key ID and you can see what key this usually refers to by reading the InitCorsairToLogiMap function.

 

Well, programming is one of the areas of IT I haven't messed too much in, but maybe I could accomplish this task after a little research - thank you for your sharings!

Link to comment
Share on other sites

  • 2 weeks later...

Hey, I want to try this today when I get home but am super scared of getting a gta online ban!

 

I'm a Dev too and I think I'll look into modiying/ extending this to some other games too! I actually play gta with a controller but love my keyboard to be coloured too! I think I'd like the police lights to flash much faster,havwbt looked into your code yet but can hapoefully write something to do it! Not that I'm much if a c++ expert! (that's what it's written in right?) Anyway, will post here if/ when I have a try! Looking forward to it, thanks man great work!

Link to comment
Share on other sites

Hey, just had a go, works really well, after I used the \\ in the path.

Managed to get 1-9 working as police lights with that code you posted which was cool, but I'd like to try to make use of the entire keyboard and make it flash a lot faster but after about 15 minutes of looking (at 2:30am) I've decided that's enough for today. Will hopefully have another crack tomorrow.

 

Awesome work man! Love it :D

Link to comment
Share on other sites

  • 2 weeks later...

Thanks! I did exactly what you described and it's working, though not like your video.

 

Example: not all keys get a fixed light with different characters, just some keys. When the police is hunting me, lots of lights blink, noit only the numbers...

 

Any ideas?

Link to comment
Share on other sites

Awesome mod, I can't wait to get it working.

 

I'm having some trouble with that, though. I have visual C++ 2013 installed and I edited the registry edit to the correct directory and included the double back slashes. It was not working so I tried it with CUE turned off, still was not working. I then went into regedit and found the entry to make sure it was correct. It was, and then I added the double back slashes the the entry itself and tried it both with CUE on and off with no avail. Should the actual entry have the double slashes or should they be single?

 

I have a corsair K70 paired with the m65 mouse. I also made sure that the in-game option for the lighting effects was turned on.

 

I thought it might have been because I had 64bit vsredist but I have the 32bit version as well.

 

Thank you in advanced!

Link to comment
Share on other sites

I've just updated the DLL to work with the latest patch but police lights don't seem to work anymore. I can't see which function they are calling for them now as only SetLighting ever gets called, which sets the entire keyboard colour.

We need to find someone with a logitech keyboard to see if police light still exist. For now, i have fixed the lighting changes based on the character and job (when online) and the colours now seem to match up with the Logitech keyboards (Blue for Michael, for some reason it used to be orange :/)

 

I can't see them removing police lights as it was a nifty feature so i'll keep looking into it

Link to comment
Share on other sites

Hey I've yet to try your fix for the patch, the Rockstar release notes aren't all that verbose though: http://gta.**********/Grand_Theft_Auto_V/Title_Update_Notes

 

I'm trying to think of any mates with Logi RGB keybaords to test the police feature...

I thought Micheal should have been blue anyway! Can't say I tried it before though...

 

Anyway as a 700+ hours Dota 2 player (yeah, that's a discussion for another day) I just tried LoL for the first time and noticed that my Logitech mouse (G300) changed colour! I think it changed depending on which team I was on. After a quick look it seems that Logi keyboards change with the game too.

 

When I get home tonight I want to look into how to get LogiLED2Corsair working with LoL, any tips on where to start?

 

Being a pretty high level businessy dev in my day job I'm a bit of a rookie when it comes to game directories and c++. I'll probably dump the dll in the game directory, see what happens and go from there! Excited.

 

Disco

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

Update 3: Seems Rockstar updated their Logitech SDK in the last patch which broke this DLL. I have adapted it to work with GTA but police lights don't seem to work anymore. I'm not sure if Rockstar removed them or they're calling some other function

 

Hi! Since Corsair recently released their SDK for the RGB keyboards I like many others here weonder if you will make an update to this mod?

 

Hopefully Rockstar will update the game to support the SDK from Corsair and there will be no need for mods in the future to get it to work. For now though it would be awesome if you could get it to work!

 

Thank you for your hard work!

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...
  • 2 months later...
  • 1 month later...

I guess this does not work for the STRAFE RGB?

I tried it and nothing worked.

 

Log says this:

<09/02/2016 - 20:43:39> Attached to process.

<09/02/2016 - 20:43:39> Logitech LED init called.

<09/02/2016 - 20:43:39> Logitech LED init called.

<09/02/2016 - 20:43:40> LogiLedSetTargetDevice called (7)

<09/02/2016 - 20:43:40> LogiLedRestoreLighting called

<09/02/2016 - 20:43:40> LogiLedSetTargetDevice called (7)

<09/02/2016 - 20:43:40> LogiLedRestoreLighting called

Link to comment
Share on other sites

  • 2 weeks later...

Long time coming but i've finally updated this to use the CUESDK :)

 

I also did some cleanup on the code and hooked up some more functions so that it works with more games.

I have tested with Tom Clancys The Division Beta and it works well!

 

One thing to note... You will need to place the CUESDK.x64_2013.dll in the same directory as any game that uses the Logitech DLL. That's the only downside to using the CUESDK

Link to comment
Share on other sites

Long time coming but i've finally updated this to use the CUESDK :)

 

I also did some cleanup on the code and hooked up some more functions so that it works with more games.

I have tested with Tom Clancys The Division Beta and it works well!

 

One thing to note... You will need to place the CUESDK.x64_2013.dll in the same directory as any game that uses the Logitech DLL. That's the only downside to using the CUESDK

 

Will putting the DLL files ban me from GTA V? I heard Rockstar checks for any unknown dll files, do they not?

 

Edit: just tested it, works well with my Strafe RGB! So did R* really remove the wanted lightings?

 

Edit 2: GTA V on PS4 changes the DualShock 4's lighting too, in addition to the character lightings there is one for your crew color and I believe pink when you're playing an online mission. Would that work with your mod too? (I've yet to try it out)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...