PyUserInput
PyUserInput copied to clipboard
Function `click` does not transform argument to `int` automatically
I tried the code in readme
but got error like this:
>>> x_dim, y_dim = m.screen_size()
>>> m.click(x_dim/2, y_dim/2, 1)
Traceback (most recent call last):
File "<pyshell#8>", line 1, in <module>
m.click(x_dim/2, y_dim/2, 1)
File "C:\Python34\lib\site-packages\pymouse\base.py", line 56, in click
self.press(x, y, button)
File "C:\Python34\lib\site-packages\pymouse\windows.py", line 32, in press
self.move(x, y)
File "C:\Python34\lib\site-packages\pymouse\windows.py", line 70, in move
windll.user32.SetCursorPos(x, y)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: Don't know how to convert parameter 1
This is because x_dim/2
is 960.0 not 960.
So, add a type coercions or modify the readme
.
Facing same error in ubuntu -
Traceback (most recent call last):
File "Joystic.py", line 34, in
I'd insta-merge a PR on https://github.com/PyUserInput/PyUserInput for such a type coercion, but I have an exam today, so I don't have the time to write and test a patch.
It's Ok.. Thanks for developing such a nice utility. All the best for your exam..