from pymouse import PyMouse
from pykeyboard import PyKeyboard
m = PyMouse()
k = PyKeyboard()
x_dim, y_dim = m.screen_size()
m.click(x_dim/2, y_dim/2, 1)
k.type_string('Hello, World!')
I get a traceback:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/user/myvenv/lib/python3.6/site-packages/pymouse/base.py", line 56, in click
self.press(x, y, button)
File "/home/user/myvenv/lib/python3.6/site-packages/pymouse/x11.py", line 90, in press
self.move(x, y)
File "/home/user/myvenv/lib/python3.6/site-packages/pymouse/x11.py", line 128, in move
fake_input(d, X.MotionNotify, x=x, y=y)
File "/home/user/myvenv/lib/python3.6/site-packages/Xlib/ext/xtest.py", line 103, in fake_input
y = y)
File "/home/user/myvenv/lib/python3.6/site-packages/Xlib/protocol/rq.py", line 1347, in __init__
self._binary = self._request.to_binary(*args, **keys)
File "/home/user/myvenv/lib/python3.6/site-packages/Xlib/protocol/rq.py", line 1069, in to_binary
static_part = struct.pack(self.static_codes, *pack_items)
struct.error: required argument is not an integer
Forcing the arguments to be integers solves this problem:
Hi,
In the first example:
I get a traceback:
Forcing the arguments to be integers solves this problem:
Note: screen size is 1366x768