-
Notifications
You must be signed in to change notification settings - Fork 251
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
Supporting higher mouse button numbers #39
Comments
Thank you for your report. The reason that buttons are represented as enums is because of the simplicity of consumption: a simple At the same time, I realise that the library breaking for arbitrary buttons is... well, bad. Unfortunately your proposed solution does not work; it will modify At the moment, the best solution I can think of is extending 5bddf97 - Added values for button 8 and 9 for Xorg to include even more buttons. While this solution may seem less elegant, there does exist some limitation on the possible number of buttons, so it might not be as bad as it seems. Another possibility is to create a different, non-enum, class for buttons greater than |
@moses-palmer My mouse (Logitech MX Performance) has 4 additional buttons numbered as 8, 9, 10, 13. I guess it is some kind of standard numbering scheme. Buttons 8 i 9 work as backward/forward in web browser. The 13 is a "zoom" button and indeed combined with scroll wheel enables zooming in web browser. Extending the enum wouId certainly work. I don't know what is the limit (maybe 255 if the number is encoded on one byte?) but it's not 9. I think it is not very difficult to create enum dynamically in python without having to list every possible value so you can easily go up to 255 with one loop. I think that using another class instead of |
I added buttons up to 30 in pynput 1.3.7. Create a new bug report when you get a new mouse :-) |
Mouse buttons with number higher than 9 are indistinguishable from each other on XOrg implementaion of mouse
Listener
. That's of course caused by enumButton
which doesn't support buttons higher than 9 and thus listener reportsButton.unknown
.I cannot see a reason for such limitation. Of course there is a workaround but I believe this should be changed anyway.
Workaround to detect button with number higher than 9 in listener:
The text was updated successfully, but these errors were encountered: