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 support for GS66 #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 6 additions & 1 deletion 99-msi-rgb.rules
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="1122", MODE="0666"
KERNEL=="hidraw*", \
SUBSYSTEM=="hidraw", \
ATTRS{idVendor}=="1038", \
ATTRS{idProduct}=="113a", \
MODE="0666", \
ACTION=="add"
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For Ubuntu or others :
```
git clone https://github.com/Askannz/msi-perkeyrgb
cd msi-perkeyrgb/
sudo python3 setup.py install
python -m pip install .
sudo cp 99-msi-rgb.rules /etc/udev/rules.d/
```

Expand All @@ -35,8 +35,8 @@ Compatibility

This tool should probably work on any recent MSI laptop with a per-key RGB keyboard. It was tested with the following models :

| Model | Basic color support
| ---- | -------------------
| Model | Basic color support
| ---- | -------------------
| GE63 | Yes
| GE73 | Yes
| GE75 | Yes
Expand All @@ -46,6 +46,7 @@ This tool should probably work on any recent MSI laptop with a per-key RGB keybo
| GS75 | Yes
| GT63 | Yes
| GT75 | Yes
| GS66 | Yes

If you have some additional test results, feel free to open a GitHub issue to help expand this list !

Expand Down
7 changes: 4 additions & 3 deletions msi_perkeyrgb/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys

ALIAS_ALL = "all"
ALIASES = {ALIAS_ALL: "9-133,fn",
ALIASES = {ALIAS_ALL: "9-133,fn,power",
"f_row": "67-76,95,96",
"arrows": "111,113,114,116",
"num_row": "10-21",
Expand Down Expand Up @@ -116,6 +116,8 @@ def parse_keycodes(msi_keymap, keys_parameter):
# Parsing
if re.fullmatch("^fn$", key_str): # Special keycode "fn"
keycodes.append("fn")
elif re.fullmatch("^power$", key_str): # Special keycode "power"
keycodes.append("power")
elif re.fullmatch("^[0-9]+$", key_str): # Single keycode
keycode = int(key_str)
if keycode not in msi_keymap.keys():
Expand All @@ -137,8 +139,7 @@ def parse_keycodes(msi_keymap, keys_parameter):

# This is a stub because there is only one mode for now. Will be modified in future versions.
def parse_mode(mode_parameter):

if mode_parameter != "steady":
if mode_parameter not in ["steady", "fade-of"]:
raise LineParseError("Unknown mode %s" % mode_parameter)


Expand Down
6 changes: 3 additions & 3 deletions msi_perkeyrgb/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from .msi_keyboard import MSI_Keyboard
from .hidapi_wrapping import HIDLibraryError, HIDNotFoundError, HIDOpenError

VERSION = "2.1"
DEFAULT_ID = "1038:1122"
DEFAULT_MODEL = "GE63" # Default laptop model if nothing specified
VERSION = "2.2"
DEFAULT_ID = "1038:113a"
DEFAULT_MODEL = "GS66" # Default laptop model if nothing specified


def main():
Expand Down
1 change: 1 addition & 0 deletions msi_perkeyrgb/protocol_data/keycodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
56,
57,
101,
102,
224,
225,
226,
Expand Down
109 changes: 108 additions & 1 deletion msi_perkeyrgb/protocol_data/msi_keymaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,112 @@
119: 76,
127: 72,
133: 227,
'fn': 240})
'fn': 240}),

(['GS66'],
{9: 41,
10: 30,
11: 31,
12: 32,
13: 33,
14: 34,
15: 35,
16: 36,
17: 37,
18: 38,
19: 39,
20: 45,
21: 46,
22: 42,
23: 43,
24: 20,
25: 26,
26: 8,
27: 21,
28: 23,
29: 28,
30: 24,
31: 12,
32: 18,
33: 19,
34: 47,
35: 48,
36: 40,
37: 224,
38: 4,
39: 22,
40: 7,
41: 9,
42: 10,
43: 11,
44: 13,
45: 14,
46: 15,
47: 51,
48: 52,
49: 53,
50: 225,
51: 49,
52: 29,
53: 27,
54: 6,
55: 25,
56: 5,
57: 17,
58: 16,
59: 54,
60: 55,
61: 56,
62: 229,
63: 85,
64: 226,
65: 44,
66: 57,
67: 58,
68: 59,
69: 60,
70: 61,
71: 62,
72: 63,
73: 64,
74: 65,
75: 66,
76: 67,
77: 83,
78: 71,
79: 95,
80: 96,
81: 97,
82: 86,
83: 92,
84: 93,
85: 94,
86: 87,
87: 89,
88: 90,
89: 91,
90: 98,
91: 99,
94: 100,
95: 68,
96: 69,
104: 88,
105: 228,
106: 84,
107: 70,
108: 230,
110: 74,
111: 82,
112: 75,
113: 80,
114: 79,
115: 77,
116: 81,
117: 78,
118: 73,
119: 76,
127: 72,
133: 227,
'fn': 240,
'power': 102})
]
92 changes: 92 additions & 0 deletions msi_perkeyrgb/protocol_data/presets/3.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion msi_perkeyrgb/protocol_data/presets_index.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PRESETS_FILES = [
(['GE63', 'GE73', 'GE75', 'GS63', 'GS73', 'GS75', 'GX63', 'GT63', 'GL63'], '1.json'),
(['GS65'], '2.json')
(['GS65'], '2.json'),
(['GS66'], '3.json')
]
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
from os.path import dirname, join
from setuptools import setup, find_packages


setup(
name='msi-perkeyrgb',
version='2.1',
version='2.2',
description='Configuration tool for per-key RGB keyboards on MSI laptops.',
long_description=open(
join(dirname(__file__), 'README.md')).read(),
Expand Down