minor typo fixes

This commit is contained in:
NeoTheFox 2021-04-16 23:47:02 +03:00
parent 6bc1bac531
commit 611621d4ab

View File

@ -31,9 +31,8 @@ BUTTON_BITS = {
0x80: 8, 0x80: 8,
} }
def main(): def main():
#Commandline arguments processing # Commandline arguments processing
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description='Linux utility to create custom key bindings for the Huion Kamvas Pro (2019), Inspiroy Q620M, and potentially other tablets.') description='Linux utility to create custom key bindings for the Huion Kamvas Pro (2019), Inspiroy Q620M, and potentially other tablets.')
parser.add_argument('--rules', action='store_true', default=False, parser.add_argument('--rules', action='store_true', default=False,
@ -101,7 +100,7 @@ class PollThread(threading.Thread):
self.cycle_mode = 1 self.cycle_mode = 1
def run(self): def run(self):
global BUTTON_BINDINGS, BUTTON_BINDINGS_HOLD, CYCLE_MODES, CYCLE_BUTTON global BUTTON_BINDINGS, BUTTON_BINDINGS_HOLD, CYCLE_MODES, CYCLE_BUTTON, DIAL_MODES
while True: while True:
try: try:
hidraw = open(self.hidraw_path, 'rb') hidraw = open(self.hidraw_path, 'rb')
@ -120,7 +119,8 @@ class PollThread(threading.Thread):
time.sleep(3) time.sleep(3)
break break
print("Got button %s" % (btn,)) print("Got button %s" % (btn,))
print(BUTTON_BINDINGS) print(CYCLE_MODES)
print(self.cycle_mode)
if btn == CYCLE_BUTTON and CYCLE_BUTTON is not None: if btn == CYCLE_BUTTON and CYCLE_BUTTON is not None:
self.cycle_mode = self.cycle_mode + 1 self.cycle_mode = self.cycle_mode + 1
if self.cycle_mode > CYCLE_MODES: if self.cycle_mode > CYCLE_MODES:
@ -135,7 +135,7 @@ class PollThread(threading.Thread):
lib.xdo_send_keysequence_window_down(self.xdo, lib.CURRENTWINDOW, BUTTON_BINDINGS_HOLD[btn], 12000) lib.xdo_send_keysequence_window_down(self.xdo, lib.CURRENTWINDOW, BUTTON_BINDINGS_HOLD[btn], 12000)
self.get_button_release(hidraw) self.get_button_release(hidraw)
print("Releasing %s" % (BUTTON_BINDINGS_HOLD[btn],)) print("Releasing %s" % (BUTTON_BINDINGS_HOLD[btn],))
lib.xdo_send_keysequence_window_up(xdo, lib.CURRENTWINDOW, BUTTON_BINDINGS_HOLD[btn], 12000) lib.xdo_send_keysequence_window_up(self.xdo, lib.CURRENTWINDOW, BUTTON_BINDINGS_HOLD[btn], 12000)
elif btn in BUTTON_BINDINGS: elif btn in BUTTON_BINDINGS:
print("Sending %s" % (BUTTON_BINDINGS[btn],)) print("Sending %s" % (BUTTON_BINDINGS[btn],))
lib.xdo_send_keysequence_window( lib.xdo_send_keysequence_window(