diff --git a/.all-contributorsrc b/.all-contributorsrc index ec58e3273..9d4694b05 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -48,7 +48,8 @@ "code", "question", "doc", - "maintenance" + "maintenance", + "review" ] }, { @@ -59,7 +60,10 @@ "contributions": [ "code", "question", - "maintenance" + "maintenance", + "projectManagement", + "review", + "doc" ] }, { @@ -185,6 +189,51 @@ "contributions": [ "question" ] + }, + { + "login": "Fluto", + "name": "Fluto", + "avatar_url": "https://avatars3.githubusercontent.com/u/7686594?v=4", + "profile": "https://github.com/Fluto", + "contributions": [ + "code" + ] + }, + { + "login": "stuntguy3000", + "name": "Luke Anderson", + "avatar_url": "https://avatars1.githubusercontent.com/u/1522389?v=4", + "profile": "http://stuntguy3000.com", + "contributions": [ + "code" + ] + }, + { + "login": "thingamajig0", + "name": "thingamajig0", + "avatar_url": "https://avatars1.githubusercontent.com/u/31176843?v=4", + "profile": "https://github.com/thingamajig0", + "contributions": [ + "code" + ] + }, + { + "login": "rushdie99", + "name": "polinyeh", + "avatar_url": "https://avatars3.githubusercontent.com/u/9208301?v=4", + "profile": "https://github.com/rushdie99", + "contributions": [ + "code" + ] + }, + { + "login": "xQwexx", + "name": "Qwex", + "avatar_url": "https://avatars3.githubusercontent.com/u/17799600?v=4", + "profile": "https://github.com/xQwexx", + "contributions": [ + "code" + ] } ], "contributorsPerLine": 7 diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 17c9f46db..57a0d098b 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,13 +1,24 @@ -## How to contribute! -#### I have found a bug! -- Please make sure that your bug was not already reported by searching the [Issues](https://github.com/antonpup/Aurora/issues). -- If your bug was already reported, please comment on the existing issue instead of making a new one. -- If your bug is new, feel free to make a [New Issue](https://github.com/antonpup/Aurora/issues/new). +# Contributing to Aurora -#### I want to contribute code! -- You can fork this repo and make changes to the code on the [dev branch](https://github.com/antonpup/Aurora/tree/dev). -- The [dev branch](https://github.com/antonpup/Aurora/tree/dev) is the usually the most up-to-date branch on the repo. -- Please ensure that your new code follows the [CamelCase](https://en.wikipedia.org/wiki/Camel_case) naming convention. -- If you want to make a pull request, please make sure that you are making a pull request into the dev branch (and not master). +### I have found a bug! +- Please make sure that your bug was not already reported by searching the [issues](https://github.com/antonpup/Aurora/issues). +- If your bug was already reported and you have additional information to provide, please comment on the existing issue. Do not create a new issue that is a duplicate of an existing one (unless it has been closed). +- If you cannot find your issue reported, please make a [New Issue](https://github.com/antonpup/Aurora/issues/new) and follow the bug report template. -We appreciate your kind efforts in making Aurora a better software! \ No newline at end of file +### I want to contribute code! +- Please first create your own fork of this repo if you do not already have one. + - If you have not done so yet, you will need to clone your repo onto your local machine for development. `git clone https://github.com/your-username/Aurora.git` + - You will also need to add the main repo as an upstream to get updated commits. `git remote add upstream https://github.com/antonpup/Aurora.git` +- Make sure your fork is up-to-date with the latest dev branch on the main repo. `git fetch upstream` +- Create a feature or fix branch from the latest dev branch. `git checkout -b feature/my-new-feature upstream/dev` + - If you plan on adding new features, please prefix your branch name with 'feature/'. For example `feature/audio-layer-improvements`. + - If you plan on fixing bugs, please prefix your branch name with 'fix/'. For example `fix/layer-selection`. + - If you are adding features and bug fixes, use 'feature/'. +- If you are adding or fixing multiple unrelated areas, please divide your code into different branches. For example, don't add a new device at the same time as you change how the overrides system works. +- Please ensure that your code follows the existing conventions set out in the code (such as using auto properties where applicable, naming conventions, etc.). +- When you have finished your feature or bug fix, push your changes to your remote branch. E.g. `git push origin feature/my-cool-feature` +- Create a [new pull request](https://github.com/antonpup/Aurora/compare) on the main Aurora repo. +- Add a descriptive title and description which includes a detailed list of what has been changed and any known issues. You may also wish to include screenshots, examples and important design decisions you made in the description too. +- A collaborator will review your PR and accept it or make suggestions on what should be changed. + +We appreciate your kind efforts in making Aurora a better software! :tada: diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 7b65d927c..5374cdc09 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,7 +1,7 @@ --- name: Bug Report about: Report an issue with how the program works. -labels: bug +labels: 'Type: Bug' --- -**Device Website:** \ No newline at end of file +**Device Website:** diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md index 751c4dc0e..08871cef8 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.md +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -1,10 +1,10 @@ --- name: Enhancement about: Got an idea for a new feature for Aurora? Put it here. -labels: enhancement +labels: 'Type: Enhancement' --- \ No newline at end of file +--> diff --git a/.github/ISSUE_TEMPLATE/game_request.md b/.github/ISSUE_TEMPLATE/game_request.md index 49d8b9936..47780e088 100644 --- a/.github/ISSUE_TEMPLATE/game_request.md +++ b/.github/ISSUE_TEMPLATE/game_request.md @@ -1,7 +1,7 @@ --- name: Game Request about: Request support for a new game or application. -labels: game support +labels: 'Type: Enhancement,Area: Game Support' --- -**Methods:** \ No newline at end of file +**Methods:** diff --git a/Installer/installer.iss b/Installer/installer.iss index a685919b2..cd83382c9 100644 --- a/Installer/installer.iss +++ b/Installer/installer.iss @@ -1,4 +1,4 @@ -#define public Version "0.6.1" +#define public Version "0.8.0" #ifdef EXTERNAL_VERSION #if len(EXTERNAL_VERSION)>0 diff --git a/Project-Aurora/Aurora-LogiLEDWrapper/dllmain.cpp b/Project-Aurora/Aurora-LogiLEDWrapper/dllmain.cpp index 58e566b67..511d0557f 100644 --- a/Project-Aurora/Aurora-LogiLEDWrapper/dllmain.cpp +++ b/Project-Aurora/Aurora-LogiLEDWrapper/dllmain.cpp @@ -763,7 +763,7 @@ bool WriteToPipe(const std::string command_cargo) return false; } -void _LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage, int custom_mode = 0) +bool _LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage, int custom_mode = 0) { unsigned char redValue = (unsigned char)((redPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((greenPercentage / 100.0f) * 255); @@ -936,7 +936,7 @@ void _LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercent ) { //No need to write on pipe, color did not change - return; + return true; } current_bg[0] = blueValue; @@ -962,11 +962,13 @@ void _LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercent contents += '}'; - WriteToPipe(contents); + return WriteToPipe(contents); } + + return false; } -void _LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval) +bool _LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval) { unsigned char redValue = (unsigned char)((redPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((greenPercentage / 100.0f) * 255); @@ -984,10 +986,10 @@ void _LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePerce contents += '}'; - WriteToPipe(contents); + return WriteToPipe(contents); } -void _LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval) +bool _LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval) { unsigned char redValue = (unsigned char)((redPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((greenPercentage / 100.0f) * 255); @@ -1005,20 +1007,20 @@ void _LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePerce contents += '}'; - WriteToPipe(contents); + return WriteToPipe(contents); } -void _LogiLedStopEffects() +bool _LogiLedStopEffects() { std::string contents = ""; contents += "\"command\": \"StopEffects\","; contents += "\"command_data\": {"; contents += '}'; - WriteToPipe(contents); + return WriteToPipe(contents); } -void _LogiLedSetLightingFromBitmap(unsigned char bitmap[]) +bool _LogiLedSetLightingFromBitmap(unsigned char bitmap[]) { if (isInitialized && (current_device == LOGI_DEVICETYPE_ALL || current_device == LOGI_DEVICETYPE_PERKEY_RGB)) { @@ -1044,11 +1046,13 @@ void _LogiLedSetLightingFromBitmap(unsigned char bitmap[]) } contents += "]"; - WriteToPipe(contents); + return WriteToPipe(contents); } + + return false; } -void _LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) +bool _LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) { unsigned char redValue = (unsigned char)((redPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((greenPercentage / 100.0f) * 255); @@ -1068,7 +1072,7 @@ void _LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int g ) { //No need to write on pipe, color did not change - return; + return true; } current_bitmap[(int)bit_location] = blueValue; @@ -1086,11 +1090,13 @@ void _LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int g contents += "}"; - WriteToPipe(contents); + return WriteToPipe(contents); } + + return false; } -void _LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) +bool _LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) { unsigned char redValue = (unsigned char)((redPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((greenPercentage / 100.0f) * 255); @@ -1110,7 +1116,7 @@ void _LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int gr ) { //No need to write on pipe, color did not change - return; + return true; } current_bitmap[(int)bit_location] = blueValue; @@ -1128,11 +1134,13 @@ void _LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int gr contents += "}"; - WriteToPipe(contents); + return WriteToPipe(contents); } + + return false; } -void _LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) +bool _LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) { unsigned char redValue = (unsigned char)((redPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((greenPercentage / 100.0f) * 255); @@ -1163,10 +1171,10 @@ void _LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int return WriteToPipe(current_bitmap, ss.str()); } */ - WriteToPipe(contents); + return WriteToPipe(contents); } -void _LogiLedSetLightingForKeyWithKeyName(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage) +bool _LogiLedSetLightingForKeyWithKeyName(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage) { unsigned char redValue = (unsigned char)((redPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((greenPercentage / 100.0f) * 255); @@ -1185,7 +1193,7 @@ void _LogiLedSetLightingForKeyWithKeyName(LogiLed::KeyName keyName, int redPerce ) { //No need to write on pipe, color did not change - return; + return true; } current_bitmap[(int)bit_location] = blueValue; @@ -1203,11 +1211,13 @@ void _LogiLedSetLightingForKeyWithKeyName(LogiLed::KeyName keyName, int redPerce contents += "}"; - WriteToPipe(contents); + return WriteToPipe(contents); } + + return false; } -void _LogiLedFlashSingleKey(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval) +bool _LogiLedFlashSingleKey(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval) { unsigned char redValue = (unsigned char)((redPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((greenPercentage / 100.0f) * 255); @@ -1226,10 +1236,10 @@ void _LogiLedFlashSingleKey(LogiLed::KeyName keyName, int redPercentage, int gre contents += '}'; - WriteToPipe(contents); + return WriteToPipe(contents); } -void _LogiLedPulseSingleKey(LogiLed::KeyName keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite) +bool _LogiLedPulseSingleKey(LogiLed::KeyName keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite) { unsigned char redValue = (unsigned char)((startRedPercentage / 100.0f) * 255); unsigned char greenValue = (unsigned char)((startGreenPercentage / 100.0f) * 255); @@ -1257,10 +1267,10 @@ void _LogiLedPulseSingleKey(LogiLed::KeyName keyName, int startRedPercentage, in contents += '}'; - WriteToPipe(contents); + return WriteToPipe(contents); } -void _LogiLedStopEffectsOnKey(LogiLed::KeyName keyName) +bool _LogiLedStopEffectsOnKey(LogiLed::KeyName keyName) { std::string contents = ""; contents += "\"command\": \"StopEffectsOnKey\","; @@ -1268,7 +1278,7 @@ void _LogiLedStopEffectsOnKey(LogiLed::KeyName keyName) contents += "\"key\": " + std::to_string(keyName); contents += '}'; - WriteToPipe(contents); + return WriteToPipe(contents); } bool LogiLedInitWithName(const char name[]) @@ -1369,9 +1379,7 @@ bool LogiLedSaveCurrentLighting() bool LogiLedSetLighting(int redPercentage, int greenPercentage, int bluePercentage, int custom_mode = 0) { - _LogiLedSetLighting(redPercentage, greenPercentage, bluePercentage, custom_mode); - - return isInitialized; + return isInitialized &_LogiLedSetLighting(redPercentage, greenPercentage, bluePercentage, custom_mode); } bool LogiLedRestoreLighting() @@ -1381,58 +1389,42 @@ bool LogiLedRestoreLighting() bool LogiLedFlashLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval) { - _LogiLedFlashLighting(redPercentage, greenPercentage, bluePercentage, milliSecondsDuration, milliSecondsInterval); - - return isInitialized; + return isInitialized & _LogiLedFlashLighting(redPercentage, greenPercentage, bluePercentage, milliSecondsDuration, milliSecondsInterval); } bool LogiLedPulseLighting(int redPercentage, int greenPercentage, int bluePercentage, int milliSecondsDuration, int milliSecondsInterval) { - _LogiLedPulseLighting(redPercentage, greenPercentage, bluePercentage, milliSecondsDuration, milliSecondsInterval); - - return isInitialized; + return isInitialized & _LogiLedPulseLighting(redPercentage, greenPercentage, bluePercentage, milliSecondsDuration, milliSecondsInterval); } bool LogiLedStopEffects() { - _LogiLedStopEffects(); - - return isInitialized; + return isInitialized & _LogiLedStopEffects(); } bool LogiLedSetLightingFromBitmap(unsigned char bitmap[]) { - _LogiLedSetLightingFromBitmap(bitmap); - - return isInitialized; + return isInitialized & _LogiLedSetLightingFromBitmap(bitmap); } bool LogiLedSetLightingForKeyWithScanCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) { - _LogiLedSetLightingForKeyWithScanCode(keyCode, redPercentage, greenPercentage, bluePercentage); - - return isInitialized; + return isInitialized & _LogiLedSetLightingForKeyWithScanCode(keyCode, redPercentage, greenPercentage, bluePercentage); } bool LogiLedSetLightingForKeyWithHidCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) { - _LogiLedSetLightingForKeyWithHidCode(keyCode, redPercentage, greenPercentage, bluePercentage); - - return isInitialized; + return isInitialized & _LogiLedSetLightingForKeyWithHidCode(keyCode, redPercentage, greenPercentage, bluePercentage); } bool LogiLedSetLightingForKeyWithQuartzCode(int keyCode, int redPercentage, int greenPercentage, int bluePercentage) { - _LogiLedSetLightingForKeyWithQuartzCode(keyCode, redPercentage, greenPercentage, bluePercentage); - - return isInitialized; + return isInitialized & _LogiLedSetLightingForKeyWithQuartzCode(keyCode, redPercentage, greenPercentage, bluePercentage); } bool LogiLedSetLightingForKeyWithKeyName(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage) { - _LogiLedSetLightingForKeyWithKeyName(keyName, redPercentage, greenPercentage, bluePercentage); - - return isInitialized; + return isInitialized & _LogiLedSetLightingForKeyWithKeyName(keyName, redPercentage, greenPercentage, bluePercentage); } bool LogiLedSaveLightingForKey(LogiLed::KeyName keyName) @@ -1447,23 +1439,17 @@ bool LogiLedRestoreLightingForKey(LogiLed::KeyName keyName) bool LogiLedFlashSingleKey(LogiLed::KeyName keyName, int redPercentage, int greenPercentage, int bluePercentage, int msDuration, int msInterval) { - _LogiLedFlashSingleKey(keyName, redPercentage, greenPercentage, bluePercentage, msDuration, msInterval); - - return isInitialized; + return isInitialized & _LogiLedFlashSingleKey(keyName, redPercentage, greenPercentage, bluePercentage, msDuration, msInterval); } bool LogiLedPulseSingleKey(LogiLed::KeyName keyName, int startRedPercentage, int startGreenPercentage, int startBluePercentage, int finishRedPercentage, int finishGreenPercentage, int finishBluePercentage, int msDuration, bool isInfinite) { - _LogiLedPulseSingleKey(keyName, startRedPercentage, startGreenPercentage, startBluePercentage, finishRedPercentage, finishGreenPercentage, finishBluePercentage, msDuration, isInfinite); - - return isInitialized; + return isInitialized & _LogiLedPulseSingleKey(keyName, startRedPercentage, startGreenPercentage, startBluePercentage, finishRedPercentage, finishGreenPercentage, finishBluePercentage, msDuration, isInfinite); } bool LogiLedStopEffectsOnKey(LogiLed::KeyName keyName) { - _LogiLedStopEffectsOnKey(keyName); - - return isInitialized; + return isInitialized & _LogiLedStopEffectsOnKey(keyName); } void LogiLedShutdown() diff --git a/Project-Aurora/Project-Aurora/Controls/KeySequence.xaml b/Project-Aurora/Project-Aurora/Controls/KeySequence.xaml index dc50f68ef..aa7cf6b29 100644 --- a/Project-Aurora/Project-Aurora/Controls/KeySequence.xaml +++ b/Project-Aurora/Project-Aurora/Controls/KeySequence.xaml @@ -20,14 +20,7 @@ - - + diff --git a/Project-Aurora/Project-Aurora/Devices/Asus/AsusDevice.cs b/Project-Aurora/Project-Aurora/Devices/Asus/AsusDevice.cs index ae4ca6bc8..5ece47ddf 100644 --- a/Project-Aurora/Project-Aurora/Devices/Asus/AsusDevice.cs +++ b/Project-Aurora/Project-Aurora/Devices/Asus/AsusDevice.cs @@ -51,7 +51,7 @@ public bool Initialize() { asusHandler?.Stop(); - asusHandler = new AsusHandler(); + asusHandler = new AsusHandler(Global.Configuration.VarRegistry.GetVariable($"{DeviceName}_enable_unsupported_version")); isActive = asusHandler.Start(); return isActive; } @@ -59,6 +59,8 @@ public bool Initialize() /// public void Shutdown() { + if (!isActive) return; + asusHandler.Stop(); isActive = false; } @@ -75,6 +77,7 @@ public bool Reconnect() { Shutdown(); Initialize(); + return isActive; } diff --git a/Project-Aurora/Project-Aurora/Devices/Asus/AsusHandler.cs b/Project-Aurora/Project-Aurora/Devices/Asus/AsusHandler.cs index e0c932564..f9fb03e46 100644 --- a/Project-Aurora/Project-Aurora/Devices/Asus/AsusHandler.cs +++ b/Project-Aurora/Project-Aurora/Devices/Asus/AsusHandler.cs @@ -25,11 +25,11 @@ public class AsusHandler /// public bool HasSdk => AuraSdk != null; - public AsusHandler() + public AsusHandler(bool enableUnsupportedVersion = false) { try { - if (CheckVersion(out string message)) + if (CheckVersion(enableUnsupportedVersion, out string message)) AuraSdk = new AuraSdk() as IAuraSdk2; else AuraSdk = null; @@ -47,12 +47,10 @@ public AsusHandler() /// Checks to see if the version of Aura installed is the correct one /// /// true if the registry entry equals to - private bool CheckVersion(out string message) + private bool CheckVersion(bool enableUnsupportedVersion, out string message) { message = null; - - bool enableUnsupportedVersion = Global.Configuration.VarRegistry.GetVariable($"{DeviceName}_disconnect_when_stop"); - + //Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Asus\AURA\Version using (var root = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32)) { @@ -178,9 +176,12 @@ public void Stop() { lock (deviceLock) { - foreach (var device in devices) - device.Stop(); - + for (var i = devices.Count - 1; i >= 0; i--) + { + var device = devices[i]; + device.Stop(false); + } + devices.Clear(); AuraSdk?.ReleaseControl(0); } diff --git a/Project-Aurora/Project-Aurora/Devices/Asus/AsusSyncClaymoreDevice.cs b/Project-Aurora/Project-Aurora/Devices/Asus/AsusSyncClaymoreDevice.cs index cbfa606ec..7154b7368 100644 --- a/Project-Aurora/Project-Aurora/Devices/Asus/AsusSyncClaymoreDevice.cs +++ b/Project-Aurora/Project-Aurora/Devices/Asus/AsusSyncClaymoreDevice.cs @@ -15,6 +15,9 @@ public AsusSyncClaymoreDevice(AsusHandler asusHandler, IAuraSyncDevice device, i protected override void ApplyColors(Dictionary colors) { + if (Global.Configuration.devices_disable_keyboard) + return; + for (int i = 0; i < Device.Lights.Count; i++) { var light = DeviceKeyToClaymore(i); diff --git a/Project-Aurora/Project-Aurora/Devices/Asus/AuraSyncDevice.cs b/Project-Aurora/Project-Aurora/Devices/Asus/AuraSyncDevice.cs index 6c064c47e..243f1003f 100644 --- a/Project-Aurora/Project-Aurora/Devices/Asus/AuraSyncDevice.cs +++ b/Project-Aurora/Project-Aurora/Devices/Asus/AuraSyncDevice.cs @@ -39,6 +39,9 @@ public AuraSyncDevice(AsusHandler asusHandler, IAuraSyncDevice device, int frame public void UpdateColors(Dictionary colors) { + if (DeviceType == AsusHandler.AsusDeviceType.Mouse && Global.Configuration.devices_disable_mouse) + return; + //empty queue while (!colorQueue.IsEmpty) colorQueue.TryDequeue(out _); @@ -66,10 +69,11 @@ public void Start() Active = true; } - public void Stop() + public void Stop(bool cancel = true) { - tokenSource.Cancel(); Active = false; + if (cancel) + tokenSource.Cancel(); } private async void Thread(CancellationToken token) diff --git a/Project-Aurora/Project-Aurora/Devices/Asus/AuraSyncKeyboardDevice.cs b/Project-Aurora/Project-Aurora/Devices/Asus/AuraSyncKeyboardDevice.cs index f07f86255..d4d67f00a 100644 --- a/Project-Aurora/Project-Aurora/Devices/Asus/AuraSyncKeyboardDevice.cs +++ b/Project-Aurora/Project-Aurora/Devices/Asus/AuraSyncKeyboardDevice.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Drawing; using AuraServiceLib; @@ -40,6 +39,9 @@ public AuraSyncKeyboardDevice(AsusHandler asusHandler, IAuraSyncKeyboard device, /// protected override void ApplyColors(Dictionary colors) { + if (Global.Configuration.devices_disable_keyboard) + return; + foreach (var keyPair in colors) { if (!deviceKeyToKey.TryGetValue(keyPair.Key, out var light)) diff --git a/Project-Aurora/Project-Aurora/Devices/Asus/Config/AsusConfigWindow.xaml b/Project-Aurora/Project-Aurora/Devices/Asus/Config/AsusConfigWindow.xaml index f5fa7dcf9..734a66e91 100644 --- a/Project-Aurora/Project-Aurora/Devices/Asus/Config/AsusConfigWindow.xaml +++ b/Project-Aurora/Project-Aurora/Devices/Asus/Config/AsusConfigWindow.xaml @@ -35,7 +35,11 @@ VerticalAlignment="Stretch" Height="auto"> - + + +