mirror of
https://github.com/duckyPad/duckyPad-Configurator.git
synced 2026-11-19 12:19:07 +01:00
testing hid sync
This commit is contained in:
+33
-1
@@ -142,4 +142,36 @@ def dump_sd(dp_path, dump_dir_path, backup_dir_path, tk_root=None, ui_text_obj=N
|
||||
dp20_h.close()
|
||||
|
||||
|
||||
# dump_sd("./dump", None, "C:\\Users\\allen\\AppData\\Roaming\\dekuNukem\\duckypad_config\\profile_backups")
|
||||
# ------------------------
|
||||
|
||||
duckypad_pid = 0xd11c
|
||||
valid_pid_list = [duckypad_pid]
|
||||
|
||||
def get_duckypad_path_uncached():
|
||||
path_dict = {}
|
||||
for device_dict in hid.enumerate():
|
||||
if device_dict['vendor_id'] == 0x0483 and device_dict['product_id'] in valid_pid_list:
|
||||
path_dict[device_dict['usage']] = device_dict['path']
|
||||
if len(path_dict) == 0:
|
||||
return None
|
||||
if 58 in path_dict:
|
||||
return path_dict[58]
|
||||
return list(path_dict.values())[0]
|
||||
|
||||
last_dp_path = None
|
||||
def get_duckypad_path(start_fresh=False):
|
||||
global last_dp_path
|
||||
if start_fresh:
|
||||
last_dp_path = None
|
||||
if last_dp_path is None:
|
||||
last_dp_path = get_duckypad_path_uncached()
|
||||
return last_dp_path
|
||||
|
||||
|
||||
duckypad_path = get_duckypad_path()
|
||||
if duckypad_path is None:
|
||||
raise OSError('duckyPad Not Found!')
|
||||
|
||||
dump_sd(duckypad_path, "./dump", "C:\\Users\\allen\\AppData\\Roaming\\dekuNukem\\duckypad_config\\profile_backups")
|
||||
|
||||
import my_compare
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user