diff --git a/zero_hid/Mouse.py b/zero_hid/Mouse.py index 29afa61..ef0bff7 100644 --- a/zero_hid/Mouse.py +++ b/zero_hid/Mouse.py @@ -5,9 +5,10 @@ class RelativeMoveRangeError(Exception): pass - class Mouse: - def __init__(self, dev = defaults.RELATIVE_MOUSE_PATH, absolute = False) -> None: + def __init__(self, dev = None, absolute = False) -> None: + if dev is None: + dev = defaults.ABSOLUTE_MOUSE_PATH if absolute else defaults.RELATIVE_MOUSE_PATH self.move = self.__move_absolute if absolute else self.__move_relative # dynamic move method self.__send_mouse_event = absolute_mouse_event if absolute else relative_mouse_event # dynamic mouse event method if not hasattr(dev, 'write'): # check if file like object