Skip to content

Commit

Permalink
feat: absolute position with clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Aug 4, 2024
1 parent 0d5b412 commit c084630
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ see [examples](examples)
| Raspberry Pi 4 | Raspbian 12 | 6.1 |
| Raspberry Pi Zero | Raspbian 5.10 | - |

## Gotachas

---
Absolute mouse used only for positining. use relative mouse for clicking etc. see examples.
12 changes: 12 additions & 0 deletions examples/mouse_absolute_and_relative.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from zero_hid import Mouse
from time import sleep

# Absolute mouse used for positioning. relative mouse used for clicking.
with Mouse(absolute=False) as rel_mouse, Mouse(absolute=True) as abs_mouse:
abs_mouse.move(5000,5000)
sleep(1)
rel_mouse.right_click()
sleep(1)
abs_mouse.move(3000,3000)
sleep(1)
rel_mouse.left_click()

0 comments on commit c084630

Please sign in to comment.