Relative (#18)

* refactoring

* basic relative mouse mode
This commit is contained in:
Maxim Devaev
2020-11-03 04:50:08 +03:00
committed by GitHub
parent 6ec82dde5d
commit 544f4b3fec
9 changed files with 246 additions and 85 deletions

View File

@@ -75,6 +75,7 @@ class Plugin(BaseHid):
"write_retries": Option(5, type=valid_int_f1),
"write_retries_delay": Option(0.1, type=valid_float_f01),
"reopen_delay": Option(0.5, type=valid_float_f01),
"absolute": Option(True, type=valid_bool),
},
"noop": Option(False, type=valid_bool),
}
@@ -130,6 +131,9 @@ class Plugin(BaseHid):
def send_mouse_move_event(self, to_x: int, to_y: int) -> None:
self.__mouse_proc.send_move_event(to_x, to_y)
def send_mouse_relative_event(self, delta_x: int, delta_y: int) -> None:
self.__mouse_proc.send_relative_event(delta_x, delta_y)
def send_mouse_wheel_event(self, delta_x: int, delta_y: int) -> None:
self.__mouse_proc.send_wheel_event(delta_x, delta_y)