poveden / EliteChroma

A tool to make Razer Chroma devices react to Elite:Dangerous in-game events
MIT License
42 stars 15 forks source link

EliteChroma disappears after a few seconds #76

Closed FieryDragon0508 closed 3 years ago

FieryDragon0508 commented 3 years ago

So basically, whenever I launch elite chroma, it goes to the system tray as expected. Whenever I click it there, my keyboard turns black for a second but then the synapse studio lighting I already have on resumes. I was able to get it to work for a few seconds somehow last night but I can’t find a way to recreate it. Regardless of what I do in the system tray, the app always crashes after about ten seconds or so. It also only crashes when elite dangerous is running.

Environment

FieryDragon0508 commented 3 years ago

If you need more details I can try my best to get them to you

FieryDragon0508 commented 3 years ago

Also, when I select the Elite Dangerous installation folder, it says that it doesn’t work. I have to go into the Elite Dangerous folder, then Products, then select elite-dangerous-64

poveden commented 3 years ago

Hi @FieryDragon0508! Thanks for reporting this. Could you please check the Windows Application Event Log just after EliteChroma closes? Look for error entries with .NET Runtime as the event source.

FieryDragon0508 commented 3 years ago

hey, I just did it again, and found an error with the source as .NET Runtime. What should I do now? @poveden

poveden commented 3 years ago

@FieryDragon0508 just paste the contents of the error here. It will help me understand what's going on.

The error I'm expecting should look something like this:

Application: EliteChroma.exe
CoreCLR Version: 4.700.20.51601
.NET Core Version: 3.1.10
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentNullException: Value cannot be null. (Parameter 'key')
at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value)
...
...
...

Thanks in advance for your help.

FieryDragon0508 commented 3 years ago

sure- here it is

Application: EliteChroma.exe CoreCLR Version: 4.700.20.51601 .NET Core Version: 3.1.10 Description: The process was terminated due to an unhandled exception. Exception Info: System.ArgumentNullException: Value cannot be null. (Parameter 'key') at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at System.Collections.Generic.Dictionary2.TryGetValue(TKey key, TValue& value) at EliteChroma.Core.Internal.OemKeyMappings.TryGetKey(String keyboardLayout, Char c, Boolean enUSOverride, VirtualKey& key, INativeMethods nativeMethods) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\Internal\OemKeyMappings.cs:line 51 at EliteChroma.Elite.Internal.KeyMappings.TryGetKey(String keyName, String keyboardLayout, Boolean enUSOverride, VirtualKey& key, INativeMethods nativeMethods) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\Elite\Internal\KeyMappings.cs:line 174 at EliteChroma.Core.Internal.KeyMappings.TryGetKey(String keyName, String keyboardLayout, Boolean enUSOverride, Key& key, INativeMethods nativeMethods) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\Internal\KeyMappings.cs:line 194 at EliteChroma.Core.LayerBase.ApplyColorToBinding(CustomKeyboardEffect grid, String bindingName, Color color) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\LayerBase.cs:line 121 at EliteChroma.Core.LayerBase.ApplyColorToBinding(CustomKeyboardEffect grid, IEnumerable`1 bindingNames, Color color) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\LayerBase.cs:line 108 at EliteChroma.Core.Layers.InterfaceModeLayer.OnRender(ChromaCanvas canvas) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\Layers\InterfaceModeLayer.cs:line 25 at EliteChroma.Core.LayerBase.OnRender(ChromaCanvas canvas, Object state) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\LayerBase.cs:line 45 at EliteChroma.Chroma.LayeredEffect.Render(IChroma chroma, Object state) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\Chroma\LayeredEffect.cs:line 36 at EliteChroma.Core.ChromaController.RenderEffect() in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\ChromaController.cs:line 238 at EliteChroma.Core.ChromaController.GameState_Changed(Object sender, ChangeType e) in D:\Dev\GitHub\poveden\EliteChroma\src\EliteChroma.Core\ChromaController.cs:line 207 at System.Threading.Tasks.Task.<>c.b__139_1(Object state) at System.Threading.QueueUserWorkItemCallbackDefaultContext.Execute() at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Did I copy paste it right? I just highlighted the text and did ctrl + c and ctrl + V

poveden commented 3 years ago

Duplicate of #74.

I'll write a fix for this and push an update as soon as I can. I'll let you know when it's done.

FieryDragon0508 commented 3 years ago

@poveden thank you so much! I'm really looking forward to being able to use this!

Just out of curiosity, what is unique about cases like #74 ? Why does this happen for some people but not others? Of course, if you are too busy or don't feel like answering, don't feel obligated to answer.

poveden commented 3 years ago

Version 1.9.2 has been published.

@FieryDragon0508 please test it and tell me how it goes.

Just out of curiosity, what is unique about cases like #74 ? Why does this happen for some people but not others? Of course, if you are too busy or don't feel like answering, don't feel obligated to answer.

Glad to answer. This issue appeared after I added support for regional keyboard layouts. When you customize keyboard bindings (like me), Elite Dangerous stores the keyboard layout along the custom bindings. However, not everyone does this, and uses the preset keyboard binding (like you, probably), which doesn't have keyboard layout info. I didn't account for this, hence the error.

Sorry for the somewhat technical explanation, but it comes with the territory. 😜

FieryDragon0508 commented 3 years ago

Works like a dream!

FieryDragon0508 commented 3 years ago

Awesome work!