Allow non-root users of appropriate groups to use module in Linux
Fortunately, this can be easily achieved by replacing _nixcommon.py with the more updated keyboard/_nixcommon.py version, and removing "ensure_root" from _nixmouse.py.
Yes, please change this.
Checking that the current user is uid = 0 is unnecessary, wrong, and harmful.
Unnecessary, because if the current user doesn't have the required permission, we'll get a runtime error anyway.
Wrong, because what we're interested in is not the UID, but whether the user has access to those input files.
Harmful, because it incentivizes running user programs as root. The kind of programs that you would write with this package should not typically be run as root.
This is a duplicate of https://github.com/boppreh/mouse/issues/78
@linux-man Do you think you have a working solution that could be PRd? This would be extremely useful in https://github.com/boppreh/keyboard as well. For example: https://github.com/boppreh/keyboard/issues/420
I implemented the changes I mentioned. You can find them at https://github.com/linux-man/inmon. Since I'm only using for catching events and it's not extensively tested, I didn't PRd.