The mouse driver abs (absolute) allows you to:
-
Position the cursor with absolute desktop coordinates. Note that this is desktop coordinates, not monitor coordinates.
-
Press and/or release the left, middle and right buttons.
About coordinates you can read here.
Search mouse absolute driver and open his handle.
Syntax:
C++: bool connectToDevice()
Python: connect_to_device() -> bool
Return value:
true - device found and handle opened.
false - device not found or connection error.
Close driver handle.
Syntax:
C++: void disconnectFromDevice()
Python: disconnect_from_device() -> None
Getting handle status.
Syntax:
C++: bool deviceConnected()
Python: device_connected() -> bool
Return value:
true - device handle opened.
false - device handle closed or not found.
Send a reset command to the mouse driver. This will release all mouse buttons.
Syntax:
C++: bool resetDriver()
Python: reset_driver() -> bool
Return value:
true - command send successful.
false - command send failed or opening handle error.
Left mouse button press and release with pause of between actions (75ms) on specific position. Other button release.
Syntax:
C++: bool clickOnPoint(unsigned short x, unsigned short y);
Python: click_on_point(x: int, y: int) -> bool
Parameters:
x - new position the cursor on X axis absolute desktop coordinates. Accepting value: [0:32767].
y - new position the cursor on Y axis absolute desktop coordinates. Accepting value: [0:32767].
Return value:
true - commands send successful.
false - any command send failed or opening handle error.
Double execute left click on point method with pause of between actions (107 ms). Other button release.
Syntax:
C++: bool doubleClickOnPoint(unsigned short x, unsigned short y)
Python: double_click_on_point(x: int, y: int) -> bool
Parameters:
x - new position the cursor on X axis absolute desktop coordinates. Accepting value: [0:32767].
y - new position the cursor on Y axis absolute desktop coordinates. Accepting value: [0:32767].
Return value:
true - commands send successful.
false - any command send failed or opening handle error.
Middle mouse button press and release with pause of between actions (75ms) on specific position. Other button release.
Syntax:
C++: bool middleClickOnPoint(unsigned short x, unsigned short y)
Python: middle_click_on_point(x: int, y: int) -> bool
Parameters:
x - new position the cursor on X axis absolute desktop coordinates. Accepting value: [0:32767].
y - new position the cursor on Y axis absolute desktop coordinates. Accepting value: [0:32767].
Return value:
true - commands send successful.
false - any command send failed or opening handle error.
Right mouse button press and release with pause of between actions (75ms) on specific position. Other button release.
Syntax:
C++: bool rightClickOnPoint(unsigned short x, unsigned short y)
Python: right_click_on_point(x: int, y: int) -> bool
Parameters:
x - new position the cursor on X axis absolute desktop coordinates. Accepting value: [0:32767].
y - new position the cursor on Y axis absolute desktop coordinates. Accepting value: [0:32767].
Return value:
true - commands send successful.
false - any command send failed or opening handle error.
Change cursor position in absolute desktop coordinates (all buttons release).
Syntax:
C++: bool moveToPoint(unsigned short x, unsigned short y)
Python: move_to_point(x: int, y: int) -> bool
Parameters:
x - new position the cursor on X axis absolute desktop coordinates. Accepting value: [0:32767].
y - new position the cursor on Y axis absolute desktop coordinates. Accepting value: [0:32767].
Return value:
true - commands send successful.
false - command send failed or opening handle error.
Set new cursor position in absolute desktop coordinates for custom action.
Syntax:
C++: void setNewPos(unsigned short x, unsigned short y)
Python: set_new_pos(x: int, y: int) -> None
Parameters:
x - new position the cursor on X axis absolute desktop coordinates. Accepting value: [0:32767].
y - new position the cursor on Y axis absolute desktop coordinates. Accepting value: [0:32767].
Set key state for custom action.
Syntax:
C++: void setButtonState(unsigned char button, bool isDown = true)
Python: set_button_state(button: int, is_down: bool = True) -> None
Parameters:
button - single button code.
isDown - button state (true - button press, false - button release).
Remarks:
Button codes table:
Button code | Button | C++ define | Python constant |
---|---|---|---|
1 | Left | MOUSE_ABS_L_BTN | hvdk.const.MOUSE_ABS_L_BTN |
4 | Middle | MOUSE_ABS_M_BTN | hvdk.const.MOUSE_ABS_M_BTN |
2 | Right | MOUSE_ABS_R_BTN | hvdk.const.MOUSE_ABS_R_BTN |
P.S. Button codes for C++ defined in src/mouseabs.h
file.
Reset data for custom action.
Syntax:
C++: void resetData()
Python: reset_data() -> None
Send data of custom action to driver.
Syntax:
C++: bool commit(bool resetDataAfterCommit = true)
Python: commit(reset_data_after_commit: bool = True) -> bool
Parameters:
resetDataAfterCommit - if set this parameter to false аfter sending the data to driver, values specified by the
setNewPos / setButtonState
methods will not be reset.
Return value:
true - commands send successful.
false - command send failed or opening handle error.
Set new value of time after send data to driver
Syntax:
C++: void setSleepTimerAfterActions(unsigned short value)
Python: set_sleep_timer_after_actions(value: int) -> None
Parameters:
value - new value in milliseconds of time after send data to driver.
Getting current value of time after send data to driver
Syntax:
C++: unsigned short getSleepTimerAfterActions()
Python: get_sleep_timer_after_actions() -> int
Return value:
value in milliseconds of time after send data to driver.
Set new value of time between actions (button press/release, double click)
Syntax:
C++: void setSleepTimerBetweenActions(unsigned short value)
Python: set_sleep_timer_between_actions(value: int) -> None
Parameters:
value - new value in milliseconds of time between actions. Accepted value >= timer after action
Getting current value of time between actions.
Syntax:
C++: unsigned short getSleepTimerAfterActions()
Python: get_sleep_timer_after_actions() -> int
Return value:
value in milliseconds of time between actions.