-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is Pynput compatible with ~~x11vnc~~ Xvfb ? #239
Comments
python3 -c "import pynput; pynput.keyboard.Controller().press(pynput.keyboard.Key.space)" |
the second line is working if you use the
but you can also use the plain character as argument to the
|
Right, my mistake, sorry. |
I am afraid that I do not completely understand your use case: are your trying to control If you provide a script to reproduce the issue, troubleshooting would be greatly simplified. |
Yes, you are right :)
|
while the expression was wrong, it seems that I was wrong too : it doesn't work with Xvfb. Here's a minimal example exhibiting the issue, with the following Dockerfile:
reproduce with:
nothing is printed to the console. |
might be related to python-xlib/python-xlib#156 ? |
Well, I received 'Xlib.error.DisplayNameError: Bad display name ""' when running
|
Anyway, 'x11vnc' is never used by you, @gregseth . So it might not be related to... |
@yannrichet yeah, fixed the Dockerfile in my comment to set the $DISPLAY variable properly |
One more step : the following code works well on docker:
which let me think that it should work with fake_input anyway... |
Well, I can solve the issue when I force calling fake_input instead of send_event in pynput.keyboard._xorg:
but I cannot decide how to properly implement this in |
Thank you for your detailed instructions. I ran your dockerfile and managed to confirm that it indeed did not work. Using I have a partial solution in This ensures that the first conditional in your snippet above succeeds, and XTEST is used. I have not run any extensive tests on this branch however, other than ensuring that unmapped keys fail. |
I get a new error, which might be just related to the new lines:
:
|
That it interesting. This feature branch adds error checking where there was none before. Do you think you could provide a listing of the values passed to |
Seems strange : recording works well (both keyboard and mouse), but replaying fails (prints some spaces instead of letters).
I used the standard examples.
Also, using debug mode of x11vnc shows that nothing is given as input to x11vnc...
Regards.
The text was updated successfully, but these errors were encountered: