diff --git a/HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs b/HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs new file mode 100644 index 000000000..147a37230 --- /dev/null +++ b/HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs @@ -0,0 +1,103 @@ +using HandheldCompanion.Inputs; +using HandheldCompanion.Utils; +using System.Collections.Generic; +using System.Numerics; +using System.Threading; +using System.Windows.Media; +using WindowsInput.Events; +using static HandheldCompanion.Utils.DeviceUtils; +namespace HandheldCompanion.Devices; + +public class AYANEOSlide : AYANEO.AYANEODevice +{ + + + public AYANEOSlide() + { + // device specific settings + ProductIllustration = "device_aya_slide"; + ProductModel = "AYANEOSlide"; + + // https://www.amd.com/en/products/apu/amd-ryzen-7-7840u + nTDP = new double[] { 15, 15, 20 }; + cTDP = new double[] { 3, 54 }; + GfxClock = new double[] { 100, 2700 }; + CpuClock = 5100; + + GyrometerAxis = new Vector3(1.0f, -1.0f, -1.0f); + GyrometerAxisSwap = new SortedDictionary + { + { 'X', 'X' }, + { 'Y', 'Z' }, + { 'Z', 'Y' } + }; + + AccelerometerAxis = new Vector3(1.0f, -1.0f, -1.0f); + AccelerometerAxisSwap = new SortedDictionary + { + { 'X', 'X' }, + { 'Y', 'Z' }, + { 'Z', 'Y' } + }; + + // device specific capacities + // Capabilities = DeviceCapabilities.FanControl; + // Capabilities |= DeviceCapabilities.DynamicLighting; + // DynamicLightingCapabilities |= LEDLevel.SolidColor; + + + ECDetails = new ECDetails + { + AddressStatusCommandPort = 0x4E, // unknown + AddressDataPort = 0x4F, // unknown + AddressFanControl = 0, // unknown + AddressFanDuty = 0, // unknown + FanValueMin = 0, // unknown + FanValueMax = 100 // unknown + }; + OEMChords.Clear(); + + OEMChords.Add(new DeviceChord("Custom Key Big", + new List { KeyCode.LControl, KeyCode.LWin, KeyCode.F17 }, + new List { KeyCode.F17, KeyCode.LControl, KeyCode.LWin }, + false, ButtonFlags.OEM1 + )); + + OEMChords.Add(new DeviceChord("Custom Key Small", + new List { KeyCode.LWin, KeyCode.D }, + new List { KeyCode.D, KeyCode.LWin }, + false, ButtonFlags.OEM2 + )); + + + OEMChords.Add(new DeviceChord("Custom Key Top Left", + new List { KeyCode.LControl, KeyCode.LWin, KeyCode.F15 }, + new List { KeyCode.F15, KeyCode.LControl, KeyCode.LWin }, + false, ButtonFlags.OEM3 + )); + + OEMChords.Add(new DeviceChord("Custom Key Top Right", + new List { KeyCode.LControl, KeyCode.LWin, KeyCode.F16 }, + new List { KeyCode.F16, KeyCode.LControl, KeyCode.LWin }, + false, ButtonFlags.OEM4 + )); + + } + + public override string GetGlyph(ButtonFlags button) + { + switch (button) + { + case ButtonFlags.OEM1: + return "\uE003"; + case ButtonFlags.OEM2: + return "\u220B"; + case ButtonFlags.OEM3: + return "\u2209"; + case ButtonFlags.OEM4: + return "\u220A"; + } + + return defaultGlyph; + } +} \ No newline at end of file diff --git a/HandheldCompanion/Devices/IDevice.cs b/HandheldCompanion/Devices/IDevice.cs index cdc4bd8f6..6359721a4 100644 --- a/HandheldCompanion/Devices/IDevice.cs +++ b/HandheldCompanion/Devices/IDevice.cs @@ -265,6 +265,9 @@ public static IDevice GetDefault() case "KUN": device = new AYANEOKUN(); break; + case "AS01": + device = new AYANEOSlide(); + break; case "NEXT Pro": case "NEXT Advance": case "NEXT": diff --git a/HandheldCompanion/HandheldCompanion.csproj b/HandheldCompanion/HandheldCompanion.csproj index 9cf318f44..c966432a1 100644 --- a/HandheldCompanion/HandheldCompanion.csproj +++ b/HandheldCompanion/HandheldCompanion.csproj @@ -66,6 +66,7 @@ + @@ -108,6 +109,7 @@ + diff --git a/HandheldCompanion/Resources/device_aya_slide.png b/HandheldCompanion/Resources/device_aya_slide.png new file mode 100644 index 000000000..15ed96bcd Binary files /dev/null and b/HandheldCompanion/Resources/device_aya_slide.png differ diff --git a/HandheldCompanion/Views/Pages/AboutPage.xaml b/HandheldCompanion/Views/Pages/AboutPage.xaml index 500aef30d..fc3503310 100644 --- a/HandheldCompanion/Views/Pages/AboutPage.xaml +++ b/HandheldCompanion/Views/Pages/AboutPage.xaml @@ -211,7 +211,7 @@ Margin="0,0,0,5" Foreground="{DynamicResource SystemControlForegroundBaseMediumBrush}" Style="{StaticResource BodyTextBlockStyle}" - Text="Nefarius, CasperH2O, B-Core, Frank东, Toomy, Havner, CoryManson, nefarius, MSeys, ShadowFlare, trippyone, MiguelLedesmaC, Cheng77777, thororen1234, fighterguard, micdah, Geckon01, Bagboii, MeikoMenmaHonma, cerahmed, indiesaudi, Radther, Staubgeborener, twjmy, m33ts4k0z, howanghk, Creaous, xerootg, quangmach, MrCivsteR, 0skillallluck" /> + Text="Nefarius, CasperH2O, B-Core, Frank东, Toomy, Havner, CoryManson, MSeys, ShadowFlare, trippyone, MiguelLedesmaC, Cheng77777, thororen1234, fighterguard, micdah, Geckon01, Bagboii, MeikoMenmaHonma, cerahmed, indiesaudi, Radther, Staubgeborener, twjmy, m33ts4k0z, howanghk, Creaous, xerootg, quangmach, MrCivsteR, 0skillallluck, DevL0rd" />