Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for ayaneo slide. #998

Merged
merged 1 commit into from
Feb 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
103 changes: 103 additions & 0 deletions HandheldCompanion/Devices/AYANEO/AYANEOSLIDE.cs
Original file line number Diff line number Diff line change
@@ -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<char, char>
{
{ 'X', 'X' },
{ 'Y', 'Z' },
{ 'Z', 'Y' }
};

AccelerometerAxis = new Vector3(1.0f, -1.0f, -1.0f);
AccelerometerAxisSwap = new SortedDictionary<char, char>
{
{ '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> { KeyCode.LControl, KeyCode.LWin, KeyCode.F17 },
new List<KeyCode> { KeyCode.F17, KeyCode.LControl, KeyCode.LWin },
false, ButtonFlags.OEM1
));

OEMChords.Add(new DeviceChord("Custom Key Small",
new List<KeyCode> { KeyCode.LWin, KeyCode.D },
new List<KeyCode> { KeyCode.D, KeyCode.LWin },
false, ButtonFlags.OEM2
));


OEMChords.Add(new DeviceChord("Custom Key Top Left",
new List<KeyCode> { KeyCode.LControl, KeyCode.LWin, KeyCode.F15 },
new List<KeyCode> { KeyCode.F15, KeyCode.LControl, KeyCode.LWin },
false, ButtonFlags.OEM3
));

OEMChords.Add(new DeviceChord("Custom Key Top Right",
new List<KeyCode> { KeyCode.LControl, KeyCode.LWin, KeyCode.F16 },
new List<KeyCode> { 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;
}
}
3 changes: 3 additions & 0 deletions HandheldCompanion/Devices/IDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
2 changes: 2 additions & 0 deletions HandheldCompanion/HandheldCompanion.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
<None Remove="Resources\device_aya_air.png" />
<None Remove="Resources\device_aya_kun.png" />
<None Remove="Resources\device_aya_next.png" />
<None Remove="Resources\device_aya_slide.png" />
<None Remove="Resources\device_ayn_loki.png" />
<None Remove="Resources\device_cncdan_nucdeck.png" />
<None Remove="Resources\device_generic.png" />
Expand Down Expand Up @@ -108,6 +109,7 @@
<ItemGroup>
<Resource Include="Resources\device_aya_kun.png" />
<Resource Include="Resources\device_cncdan_nucdeck.png" />
<Resource Include="Resources\device_aya_slide.png" />
<Resource Include="Resources\device_gpd_winmini.png" />
<Resource Include="Resources\device_legion_go.png" />
</ItemGroup>
Expand Down
Binary file added HandheldCompanion/Resources/device_aya_slide.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion HandheldCompanion/Views/Pages/AboutPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" />

<!-- Description -->
<TextBlock
Expand Down
Loading