Since jinput was written to be platform independent it has no plugin for the Windows specific XInput API. This can cause XBox gamepads to not function properly. This library aims to solve the problem by providing such a plugin.
The components within this plugin were written with the XInput-Wrapper to enable access to the XInput API.
ControllerEnvironment env = new XInputEnvironmentPlugin();
if(!env.isSupported()) {
env = ControllerEnvironment.getDefaultEnvironment();
}
Controller[] controllers = env.getControllers();
In order to use XInput-Plugin-for-JInput as a Maven dependency in your own projects you first have to include Jitpack as a repository to your POM.
<project>
...
<repositories>
...
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
...
</repositories>
...
</project>
Then add the following as dependency:
<dependency>
<groupId>com.github.RalleYTN</groupId>
<artifactId>XInput-Plugin-for-JInput</artifactId>
<!-- NOTE: You can also use the commit ID as version number -->
<version>1.2.1</version>
</dependency>
- BUGFIX #3: Fixed a bug that caused rumblers to not function as intended. WARNING when updating from a previous version make sure to test wether the rumbling intensity is still within the desired range. It could happen that rumbling now has double the intensity.
- TEMPORARY BUGFIX: rumblers do not work as intended due to a problem with unsigned integers in the XInput Wrapper library; a proper fix will come at a later date
- Made the library compatible with Java 11
- Updated dependencies
- Switched from Travis CI to CircleCI
- If a gamepad has no rumblers, no Rumbler objects will be returned.
- If a gamepad has no navigation (no START, BACK and POV) then these components will not be returned.
- Added a
module-info.java
.
- Release
MIT License
Copyright (c) 2018 Ralph Niemitz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.