Skip to content

Commit 3aa5167

Browse files
authored
Merge pull request #27 from ematt/dev
MSI GP66 support
2 parents 15e6917 + 80d61bf commit 3aa5167

8 files changed

Lines changed: 393 additions & 8 deletions

File tree

Project-Aurora/Project-Aurora/Devices/DeviceKeys.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,7 +1295,13 @@ public enum DeviceKeys
12951295
/// Calculator Key
12961296
/// </summary>
12971297
[Description("Calculator")]
1298-
CALC = 216,
1298+
CALC = 216,
1299+
1300+
///<summary>
1301+
/// Power Key
1302+
/// </summary>
1303+
[Description("Power")]
1304+
POWER = 217,
12991305

13001306
/// <summary>
13011307
/// Peripheral Light 1

Project-Aurora/Project-Aurora/Devices/SteelSeries/SteelSeriesDevice.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public enum SteelSeriesKeyCodes
2121
G3 = 0xEB,
2222
G4 = 0xEC,
2323
G5 = 0xED,
24+
MSI_FN = 0xF0,
2425
};
2526

2627
class SteelSeriesDevice : IDevice
@@ -341,7 +342,10 @@ public static byte GetHIDCode(DeviceKeys key)
341342
case (DeviceKeys.LOGO):
342343
return (byte)SteelSeriesKeyCodes.LOGO;
343344
case (DeviceKeys.FN_Key):
344-
return (byte)SteelSeriesKeyCodes.SS_KEY;
345+
if (Global.Configuration.KeyboardBrand == Settings.PreferredKeyboard.MSI_GP66_US)
346+
return (byte)SteelSeriesKeyCodes.MSI_FN;
347+
else
348+
return (byte)SteelSeriesKeyCodes.SS_KEY;
345349
case (DeviceKeys.G0):
346350
return (byte)SteelSeriesKeyCodes.G0;
347351
case (DeviceKeys.G1):
@@ -588,6 +592,8 @@ public static byte GetHIDCode(DeviceKeys key)
588592
return (byte)USBHIDCodes.NUM_ZERO;
589593
case (DeviceKeys.NUM_PERIOD):
590594
return (byte)USBHIDCodes.NUM_PERIOD;
595+
case (DeviceKeys.POWER):
596+
return (byte)USBHIDCodes.POWER;
591597

592598
default:
593599
return (byte)USBHIDCodes.ERROR;

Project-Aurora/Project-Aurora/Devices/SteelSeries/USBHIDCodes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ public enum USBHIDCodes
114114

115115
BACKSLASH_UK = 0x64, // Keyboard Non-US \ and |
116116
APPLICATION_SELECT = 0x65,
117+
POWER = 0x66,
117118

118-
// skip unused special keys from 0x66 to 0xA4
119-
//0x66 Keyboard Power
119+
// skip unused special keys from 0x67 to 0xA4
120120
//0x67 Keypad =
121121
//0x68 Keyboard F13
122122
//0x69 Keyboard F14

Project-Aurora/Project-Aurora/Settings/Configuration.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ public enum PreferredKeyboard
311311
[Description("Keychron q1 knob ansi 75%")]
312312
Keychron_Q1_Knob_Ansi = 0107,
313313

314+
//MSI range is 1500-1599
315+
[Description("MSI GP66 US")]
316+
MSI_GP66_US = 1500,
317+
314318
}
315319

316320
public enum PreferredKeyboardLocalization

Project-Aurora/Project-Aurora/Settings/KeyboardLayoutManager.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,9 @@ public void LoadBrand(PreferredKeyboard keyboard_preference = PreferredKeyboard.
762762
layoutConfigPath = Path.Combine(layoutsPath, "drevo_blademaster.json");
763763
else if (keyboard_preference == PreferredKeyboard.Wooting_Two)
764764
layoutConfigPath = Path.Combine(layoutsPath, "wooting_two.json");
765-
765+
else if (keyboard_preference == PreferredKeyboard.MSI_GP66_US)
766+
layoutConfigPath = Path.Combine(layoutsPath, "msi_gp66_us.json");
767+
766768
else if (keyboard_preference == PreferredKeyboard.Uniwill2ND_35X_1)
767769
layoutConfigPath = Path.Combine(layoutsPath, "Uniwill2ND_35X_1.json");
768770
else if (keyboard_preference == PreferredKeyboard.Uniwill2ND_35X_2)

Project-Aurora/Project-Aurora/Utils/PointerUpdateUtils.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public static async Task FetchPointers(string branch, bool useOctokit = false)
5555
// Use Octokit to get pointer files through API
5656
try
5757
{
58-
IReadOnlyCollection<RepositoryContent> repoFile = await octokitClient.Repository.Content.GetAllContentsByRef("antonpup", "Aurora", repoPath + "/" + app + ".json", branch);
58+
IReadOnlyCollection<RepositoryContent> repoFile = await octokitClient.Repository.Content.GetAllContentsByRef("Aurora-RGB", "Aurora", repoPath + "/" + app + ".json", branch);
5959
File.WriteAllText(Path.Combine(pointerPath, repoFile.ElementAt(0).Name), repoFile.ElementAt(0).Content);
6060
}
6161
catch (Exception e)
@@ -93,7 +93,7 @@ public static async Task FetchDevPointers(string branch, bool useOctokit = false
9393
string repoPath = "Project-Aurora/Project-Aurora/Pointers";
9494

9595
// API call to get directory in repo where pointer jsons are held
96-
IReadOnlyCollection<RepositoryContent> content = await octokitClient.Repository.Content.GetAllContentsByRef("antonpup", "Aurora", repoPath, branch);
96+
IReadOnlyCollection<RepositoryContent> content = await octokitClient.Repository.Content.GetAllContentsByRef("Aurora-RGB", "Aurora", repoPath, branch);
9797

9898
foreach (RepositoryContent pointerRepoFiles in content)
9999
{
@@ -102,7 +102,7 @@ public static async Task FetchDevPointers(string branch, bool useOctokit = false
102102
// Use Octokit to get pointer files through API
103103
try
104104
{
105-
IReadOnlyCollection<RepositoryContent> repoFile = await octokitClient.Repository.Content.GetAllContentsByRef("antonpup", "Aurora", repoPath + "/" + pointerRepoFiles.Name, branch);
105+
IReadOnlyCollection<RepositoryContent> repoFile = await octokitClient.Repository.Content.GetAllContentsByRef("Aurora-RGB", "Aurora", repoPath + "/" + pointerRepoFiles.Name, branch);
106106
File.WriteAllText(Path.Combine(pointerPath, repoFile.ElementAt(0).Name), repoFile.ElementAt(0).Content);
107107
}
108108
catch (Exception e)
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"group_tag": "keyboard",
3+
"origin_region": 3,
4+
"grouped_keys": [
5+
6+
{
7+
"visualName": "DEL",
8+
"tag": 31,
9+
"margin_left": 515.0,
10+
"margin_top": -222.0,
11+
"width": 30.0,
12+
"height": 15.0,
13+
"font_size": 9.0,
14+
"width_bits": 3,
15+
"height_bits": 3,
16+
"margin_left_bits": 4,
17+
"margin_top_bits": -3,
18+
"enabled": true,
19+
"absolute_location": true
20+
},
21+
22+
{
23+
"visualName": "PWR",
24+
"tag": 217,
25+
"margin_left": 555.0,
26+
"margin_top": -222.0,
27+
"width": 30.0,
28+
"height": 15.0,
29+
"font_size": 9.0,
30+
"width_bits": 3,
31+
"height_bits": 3,
32+
"margin_left_bits": 4,
33+
"margin_top_bits": -3,
34+
"enabled": true,
35+
"absolute_location": true
36+
},
37+
38+
{
39+
"visualName": "HOME",
40+
"tag": 32,
41+
"margin_left": 555.0,
42+
"margin_top": -185.0,
43+
"width": 30.0,
44+
"height": 30.0,
45+
"font_size": 9.0,
46+
"width_bits": 3,
47+
"height_bits": 3,
48+
"margin_left_bits": 4,
49+
"margin_top_bits": -3,
50+
"enabled": true,
51+
"absolute_location": true
52+
},
53+
54+
55+
{
56+
"visualName": "PGUP",
57+
"tag": 33,
58+
"margin_left": 555.0,
59+
"margin_top": -150.0,
60+
"width": 30.0,
61+
"height": 30.0,
62+
"font_size": 9.0,
63+
"width_bits": 3,
64+
"height_bits": 3,
65+
"margin_left_bits": 4,
66+
"margin_top_bits": -3,
67+
"enabled": true,
68+
"absolute_location": true
69+
},
70+
{
71+
"visualName": "PGDN",
72+
"tag": 54,
73+
"margin_left": 555.0,
74+
"margin_top": -112.0,
75+
"width": 30.0,
76+
"height": 30.0,
77+
"font_size": 9.0,
78+
"width_bits": 3,
79+
"height_bits": 3,
80+
"margin_left_bits": 4,
81+
"margin_top_bits": -3,
82+
"enabled": true,
83+
"absolute_location": true
84+
},
85+
{
86+
"visualName": "END",
87+
"tag": 53,
88+
"margin_left": 555.0,
89+
"margin_top": -74.0,
90+
"width": 30.0,
91+
"height": 30.0,
92+
"font_size": 9.0,
93+
"width_bits": 3,
94+
"height_bits": 3,
95+
"margin_left_bits": 4,
96+
"margin_top_bits": -3,
97+
"enabled": true,
98+
"absolute_location": true
99+
},
100+
101+
{
102+
"visualName": "\\",
103+
"tag": 51,
104+
"margin_left": 485.0,
105+
"margin_top": -149.0,
106+
"width": 60.0,
107+
"height": 30.0,
108+
"font_size": 9.0,
109+
"enabled": true,
110+
"absolute_location": true
111+
},
112+
113+
{
114+
"visualName": "FN",
115+
"tag": 107,
116+
"margin_left": 405.0,
117+
"margin_top": -37.0,
118+
"width": 30.0,
119+
"height": 30.0,
120+
"font_size": 9.0,
121+
"width_bits": 3,
122+
"height_bits": 3,
123+
"margin_left_bits": 4,
124+
"margin_top_bits": -3,
125+
"enabled": true,
126+
"absolute_location": true
127+
},
128+
{
129+
"visualName": "\\",
130+
"tag": 77,
131+
"margin_left": 370.0,
132+
"margin_top": -37.0,
133+
"width": 30.0,
134+
"height": 30.0,
135+
"font_size": 9.0,
136+
"enabled": true,
137+
"absolute_location": true
138+
}
139+
]
140+
}

0 commit comments

Comments
 (0)