You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add support for Linux users without the input group #69
Jinput on Linux requires the user to be the member of the input group. This seems like an extra requirement that should not be needed in most cases.
I've been using my computer and playing various games on Steam and outside of Steam, with gamepad support and my keyboard while not being a member of the input group. If most games do not need the input group to support keyboard and controllers, I assume there should be a way to avoid it in jinput too.
If it turns out the the input group is required, it may be a good idea to throw an exception (or at least log an error) explaining that the controllers can't be accessed due to a probable lack of permissions.
If you want to access the plain old joystick interface /dev/input/js0, that file is world-readable in Ubuntu 22 and with that your claim would hold true.
However there is a more modern event based interface with device nodes /dev/input/eventXX - these are not world readable. So you'd definitely need to be a member of the group. JInput will not get around this as it is part of the Linux security model.
But that raises the question which of the interfaces is used by JInput. Using the event based model would eliminate the Java code to perform polling of the joystick status and even allow access to force feedback functionality. It would be good to know which mechanism JInput uses (could be chosen at runtime) and allow for extensions for force feedback.
Activity
HiranChaudhuri commentedon Jan 16, 2023
If you want to access the plain old joystick interface /dev/input/js0, that file is world-readable in Ubuntu 22 and with that your claim would hold true.
However there is a more modern event based interface with device nodes /dev/input/eventXX - these are not world readable. So you'd definitely need to be a member of the group. JInput will not get around this as it is part of the Linux security model.
But that raises the question which of the interfaces is used by JInput. Using the event based model would eliminate the Java code to perform polling of the joystick status and even allow access to force feedback functionality. It would be good to know which mechanism JInput uses (could be chosen at runtime) and allow for extensions for force feedback.