Skip to content

Commit

Permalink
Fix multi macros #9
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltris authored Dec 23, 2019
1 parent a236079 commit 2eb952b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion GK6X/KeyboardDevice.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using HidSharp;
using HidSharp;
using System;
using System.Collections.Generic;
using System.Linq;
Expand Down Expand Up @@ -292,6 +292,9 @@ public void SetMacros(KeyboardLayer layer, UserDataFile userData)
Buffer.BlockCopy(buffer, crcDataStartIndex, bytesToCrc, 0, bytesToCrc.Length);
ushort crc = Crc16.GetCrc(bytesToCrc);

// Always 0?
packet.WriteByte(0);

int tempIndex = packet.Index;
packet.Index = crcIndex;
packet.WriteUInt16(crc);
Expand Down Expand Up @@ -351,6 +354,7 @@ public Packet WritePacket(OpCodes op1, byte op2, Packet packet, byte op3 = 0)
case OpCodes.LayerSetKeyPressLightingEffect:
case OpCodes.LayerSetKeyValues:
case OpCodes.LayerFnSetKeyValues:
case OpCodes.LayerSetMacros:
offsetOffset = 2;
lengthOffset = 4;
break;
Expand Down

0 comments on commit 2eb952b

Please sign in to comment.