Skip to content

Instantly share code, notes, and snippets.

@cornernote
Last active May 28, 2020
Embed
What would you like to do?
G815 Notes

G815 Notes

Data Dumps:

Resources:

Info Derived from Wireshark

Prefix: 11ff

Setup Commands

command format:

[prefix][command]
  • 111b02 - run before enable g-keys
  • 0a2b00 - disable g-keys
  • 0a2b01 - enable g-keys
  • 111a01 - reset to saved state (disable g-keys)

Macro Key Inputs

input format:

[prefix][input]
eg: 
11ff0a0000000000000000000000000000000000 - gX release
  • 0a0000 gX - release

  • 0a0001 g1 - press

  • 0a0002 g2 - press

  • 0a0004 g3 - press

  • 0a0008 g4 - press

  • 0a0010 g5 - press

  • 0b0000 mX - release

  • 0b0001 m1 - press

  • 0b0002 m2 - press

  • 0b0004 m3 - press

  • 0c0000 mr - release

  • 0c0001 mr - press

Macro Key Lights

command format:

[prefix][command]
eg: 
11ff0b1c01000000000000000000000000000000 - M1 on

M1-M3 lights:

  • 0b1c01 - M1 on
  • 0b1c02 - M2 on
  • 0b1c04 - M3 on

MR lights:

  • 0c0c00 - MR off
  • 0c0c01 - MR on

RGB Commands

command format:

[prefix][option][command][extra]

option:

  • 10 - set RBG values

commands:

  • 7f/7a - commit - after each line
  • 1f/1a - set keys RGB - [extra] = [key1][color1][key2][color2]...
  • 1b - set logo RGB - [extra] = [key][color]
  • 6a - multi keys - [extra] = [color][key1][key2]...

keys:

  • d2 - logo
  • 99 - backlight
  • 9b - play/pause
  • 9c - next
  • 9d - mute
  • 9e - prev
  • b4 - G1
  • b5 - G2
  • b6 - G3
  • b7 - G4
  • b8 - G5
  • 01 - A
  • 1b - 1
#!/usr/bin/python2
import sys
import os.path
import imp
import usb.core
import usb.util
from time import sleep
dev = None
intf = None
def attach():
global dev
global intf
dev = usb.core.find(idVendor=0x046d, idProduct=0xc33f)
if dev is None:
print 'Device not found, exiting...'
sys.exit()
intf = 1
if dev.is_kernel_driver_active(intf) is True:
dev.detach_kernel_driver(intf)
usb.util.claim_interface(dev, intf)
def detach():
global dev
global intf
if intf is not None:
usb.util.release_interface(dev, intf)
dev.attach_kernel_driver(intf)
dev = None
intf = None
def send(data):
attach()
print data
data = [int(''.join([data[i], data[i + 1]]), base=16) for i in range(0, len(data), 2)]
dev.ctrl_transfer(0x21, 0x09, 0x0211, 1, data)
sleep(0.01)
detach()
def main():
send('11ff111b02000000000000000000000000000000') # run this before enable/disable m-keys, keyboard goes black after running
send('11ff0a2b01000000000000000000000000000000') # enable m-keys
# send('11ff0a2b00000000000000000000000000000000') # disable m-keys
# send('11ff111a01000000000000000000000000000000') # reset to non-g-keys, keyboard goes back into color mode, M1-M3 change colours
# send('11ff0b1c01000000000000000000000000000000') # M1 light
# sleep(1)
# send('11ff0b1c02000000000000000000000000000000') # M2 light
# sleep(1)
# send('11ff0b1c04000000000000000000000000000000') # M3 light
# sleep(1)
# send('11ff0c0c01000000000000000000000000000000') # MR on
# sleep(1)
# send('11ff0c0c00000000000000000000000000000000') # MR off
# sleep(1)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment