Skip to content

Commit

Permalink
Stirx Numpad fixes seerge#1638
Browse files Browse the repository at this point in the history
  • Loading branch information
seerge committed Nov 23, 2023
1 parent 93d639f commit 36d6d6a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
5 changes: 5 additions & 0 deletions app/AppConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ public static bool IsStrixLimitedRGB()
return ContainsModel("G614JV") || ContainsModel("G614JZ") || ContainsModel("G512LI") || ContainsModel("G513RS") || ContainsModel("G513RM") || ContainsModel("G713PV") || ContainsModel("G513IE");
}

public static bool IsStrixNumpad()
{
return ContainsModel("G713R");
}

public static bool IsZ13()
{
return ContainsModel("Z13");
Expand Down
31 changes: 28 additions & 3 deletions app/USB/Aura.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public static class Aura

static bool isACPI = AppConfig.IsTUF() || AppConfig.IsVivobook();
static bool isStrix = AppConfig.IsStrix();

static bool isStrix4Zone = AppConfig.IsStrixLimitedRGB();
static bool isStrixNumpad = AppConfig.IsStrixNumpad();

static public bool isSingleColor = false;

Expand Down Expand Up @@ -379,16 +381,39 @@ public static void ApplyPower()
174, 173, 172, 171, 170, 169,
/* KSTN LOGO LIDL LIDR */
0, 167, 176, 177,
=

};


static byte[] packetZone = new byte[]
{
/* VDN VUP MICM HPFN ARMC */
0, 0, 1, 1, 1,
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 DEL15 DEL17 PAUS PRT HOM */
0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BSPC BSPC BSPC PLY15 NMLK NMDV NMTM NMMI */
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* TAB Q W E R T Y U I O P [ ] \ STP15 NM7 NM8 NM9 NMPL */
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
/* CPLK A S D F G H J K L ; " # ENTR ENTR ENTR PRV15 NM4 NM5 NM6 NMPL */
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* LSFT ISO\ Z X C V B N M , . / RSFT RSFT RSFT ARWU NXT15 NM1 NM2 NM3 NMER */
0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3,
/* LCTL LFNC LWIN LALT SPC RALT RFNC RCTL ARWL ARWD ARWR PRT15 NM0 NMPD NMER */
0, 0, 0, 0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
/* LB1 LB1 LB3 LB4 LB5 LB6 */
5, 5, 4, 6, 7, 7,
/* KSTN LOGO LIDL LIDR */
3, 0, 0, 3,

};


static byte[] packetZoneNumpad = new byte[]
{
/* VDN VUP MICM HPFN ARMC */
0, 0, 0, 1, 1,
/* ESC F0 F0 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 DEL15 DEL17 PAUS PRT HOM */
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 DEL15 DEL17 PAUS PRT HOM */
0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3,
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BSPC BSPC BSPC PLY15 NMLK NMDV NMTM NMMI */
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
Expand Down Expand Up @@ -450,7 +475,7 @@ public static void ApplyDirect(Color[] color, bool init = false)
for (int ledIndex = 0; ledIndex < packetMap.Count(); ledIndex++)
{
ushort offset = (ushort)(3 * packetMap[ledIndex]);
byte zone = packetZone[ledIndex];
byte zone = isStrixNumpad ? packetZoneNumpad[ledIndex] : packetZone[ledIndex];

keyBuf[offset] = color[zone].R;
keyBuf[offset + 1] = color[zone].G;
Expand Down

0 comments on commit 36d6d6a

Please sign in to comment.