-
Notifications
You must be signed in to change notification settings - Fork 136
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
Mouse movements/hooks work, but mouse clicks do not. (kubuntu cosmic 18.10, KDE/Plasma) #37
Comments
Yep, I'm getting a similar problem. I also tried mouse.press and mouse.release, neither of those worked either. Ubuntu 20.04 though, with python 3.8 |
I am also experiencing this issue, on Pop!_Os (Ubuntu 20.10). As a workaround I reverted to using xdotools: |
I have this issue on manjaro with python 3.9 |
I reproduced this as well. I tracked it down by reading the code and seeing that on POSIX systems the library is using the uinput module. After creating a sample program based on this blog post I was able to figure out that the issue comes down to this call: # From _nixcommon.py lines 34 - 39
UI_SET_KEYBIT = 0x40045565
for i in range(256):
fcntl.ioctl(uinput, UI_SET_KEYBIT, i) I'm not sure why this is necessary. In my sample C program the analagous call is: ioctl(fd, UI_SET_KEYBIT, BTN_LEFT); Where fcntl.ioctl(uinput, UI_SET_KEYBIT, 0x00000110) ...and button clicks work again. I'd submit a PR if I knew this was stable on other systems, but I don't know that for sure. |
there is no cost to making a pr, it'd facilitate testing on other systems as well |
Can confirm this fixes the issue (Linux Manjaro user here), thanks for your investigation and help! :) |
Unfortunately this didn't work for me, so I went with @ebbit1q 's solution for the time being |
While it is true that using this command enables BTN_LEFT (0x110) it does nothing for the other buttons, such as BTN_RIGHT, BTN_MIDDLE, BTN_SIDE and BTN_EXTRA. # _nixcommon.py - Line 32 - 33
for i in range(0x115):
fcntl.ioctl(uinput, UI_SET_KEYBIT, i) The button with the highest number seems to be BTN_EXTRA (0x114), which can be seen in |
Title.
The test case is as simple as:
(alongside this,
mouse.wait()
andmouse.record()
work, butmouse.replay()
will replay movements but not clicks)(the
mouse
directory is a fresh clone of this repository)I'm not intimately familiar with how
mouse
interacts with linux on an i/o level, so i'm going to attempt to provide as much useful information as possible. Let me know what specific information you'd need about my environment.This is a relatively vanilla installation of kubuntu:
With the standard KDE window manager.
Nothing appears in dmesg except for the
input: Virtual Keyboard as /devices/virtual/input/input##
messages.The text was updated successfully, but these errors were encountered: