Skip to content
Snippets Groups Projects
Unverified Commit 6afb1905 authored by Dennis Lambe Jr's avatar Dennis Lambe Jr Committed by Luca Weiss
Browse files

driver: raise maximum DPI to 20000

This is required for several new devices.

Fixes #1379
parent e5707574
No related branches found
No related tags found
No related merge requests found
...@@ -1068,8 +1068,8 @@ struct razer_report razer_chroma_misc_set_dpi_xy(unsigned char variable_storage, ...@@ -1068,8 +1068,8 @@ struct razer_report razer_chroma_misc_set_dpi_xy(unsigned char variable_storage,
struct razer_report report = get_razer_report(0x04, 0x05, 0x07); struct razer_report report = get_razer_report(0x04, 0x05, 0x07);
// Keep the DPI within bounds // Keep the DPI within bounds
dpi_x = clamp_u16(dpi_x, 128, 16000); dpi_x = clamp_u16(dpi_x, 100, 20000);
dpi_y = clamp_u16(dpi_y, 128, 16000); dpi_y = clamp_u16(dpi_y, 100, 20000);
report.arguments[0] = VARSTORE; report.arguments[0] = VARSTORE;
......
...@@ -22,8 +22,8 @@ def parse_args(): ...@@ -22,8 +22,8 @@ def parse_args():
parser = argparse.ArgumentParser(description="Set the mouse DPI") parser = argparse.ArgumentParser(description="Set the mouse DPI")
parser.add_argument('-d', '--device', type=str, help="Device string like \"0003:1532:0045.000C\"") parser.add_argument('-d', '--device', type=str, help="Device string like \"0003:1532:0045.000C\"")
parser.add_argument('--dpi_x', required=True, type=int, help="DPI on the X axis (100, 16000)") parser.add_argument('--dpi_x', required=True, type=int, help="DPI on the X axis (100, 20000)")
parser.add_argument('--dpi_y', type=int, help="DPI on the Y axis (if omitted, dpi_x is used), (100, 16000)") parser.add_argument('--dpi_y', type=int, help="DPI on the Y axis (if omitted, dpi_x is used), (100, 20000)")
args = parser.parse_args() args = parser.parse_args()
return args return args
...@@ -50,11 +50,11 @@ def run(): ...@@ -50,11 +50,11 @@ def run():
print("Multiple mouse directories found. Rerun with -d", file=sys.stderr) print("Multiple mouse directories found. Rerun with -d", file=sys.stderr)
sys.exit(1) sys.exit(1)
dpi_x = clamp_to_min_max(args.dpi_x, 100, 16000) dpi_x = clamp_to_min_max(args.dpi_x, 100, 20000)
if args.dpi_y is None: if args.dpi_y is None:
byte_string = struct.pack(">H", dpi_x) byte_string = struct.pack(">H", dpi_x)
else: else:
dpi_y = clamp_to_min_max(args.dpi_y, 100, 16000) dpi_y = clamp_to_min_max(args.dpi_y, 100, 20000)
byte_string = struct.pack(">HH", dpi_x, dpi_y) byte_string = struct.pack(">HH", dpi_x, dpi_y)
set_mouse_dpi_filepath = os.path.join(mouse_dir, "dpi") set_mouse_dpi_filepath = os.path.join(mouse_dir, "dpi")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment