Skip to content

Commit

Permalink
qmk_gui: Add buttons for factory mode
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Schaefer <dhs@frame.work>
  • Loading branch information
JohnAZoidberg committed Aug 8, 2023
1 parent e866707 commit ce38041
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions qmk_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,8 @@ def main(devices):
[sg.HorizontalSeparator()],
[sg.Text("BIOS Mode")],
[sg.Button("Enable", k='-BIOS-MODE-ENABLE-'), sg.Button("Disable", k='-BIOS-MODE-DISABLE-')],
[sg.Text("Factory Mode")],
[sg.Button("Enable", k='-FACTORY-MODE-ENABLE-'), sg.Button("Disable", k='-FACTORY-MODE-DISABLE-')],

[sg.HorizontalSeparator()],
[sg.Text("Save Settings")],
Expand Down Expand Up @@ -284,6 +286,11 @@ def main(devices):
if event == "-BIOS-MODE-DISABLE-":
bios_mode(dev, False)

if event == "-FACTORY-MODE-ENABLE-":
factory_mode(dev, True)
if event == "-FACTORY-MODE-DISABLE-":
factory_mode(dev, False)

if event == '-BRIGHTNESS-':
set_brightness(dev, int(values['-BRIGHTNESS-']))
set_rgb_brightness(dev, int(values['-BRIGHTNESS-']))
Expand Down Expand Up @@ -555,6 +562,11 @@ def bios_mode(dev, enable):
send_message(dev, BOOTLOADER_JUMP, [0x05, param], 0)


def factory_mode(dev, enable):
param = 0x01 if enable else 0x00
send_message(dev, BOOTLOADER_JUMP, [0x06, param], 0)


def set_rgb_brightness(dev, brightness):
set_rgb_u8(dev, RGB_MATRIX_VALUE_BRIGHTNESS, brightness)

Expand Down

0 comments on commit ce38041

Please sign in to comment.