-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Joy axis update #1483
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
Joy axis update #1483
Conversation
Some controllers (such as wireless Xbox 360 controllers on Linux) use the same names for both buttons and controllers (i.e. both the right trigger axis and the right bumper button are named "5").
This allows developers to restrict a certain axis to a bound set of values (for example, preventing a one-way trigger access from going below 0, or compensating for a damaged joystick.
Better for backwards compatibility.
|
Thanks for contributing! |
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java
Outdated
Show resolved
Hide resolved
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java
Outdated
Show resolved
Hide resolved
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java
Outdated
Show resolved
Hide resolved
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java
Show resolved
Hide resolved
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java
Show resolved
Hide resolved
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java
Outdated
Show resolved
Hide resolved
jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java
Outdated
Show resolved
Hide resolved
# Conflicts: # jme3-core/src/main/java/com/jme3/input/JoystickCompatibilityMappings.java # jme3-core/src/main/java/com/jme3/input/event/JoyAxisEvent.java # jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java
jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java
Outdated
Show resolved
Hide resolved
jme3-lwjgl/src/main/java/com/jme3/input/lwjgl/JInputJoyInput.java
Outdated
Show resolved
Hide resolved
stephengold
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Next time, please don't reformat the code (unless that's the main purpose of the PR). It makes code review unnecessarily difficult.
|
Right. Sorry for the pain. I still haven't figured out entirely how to get Android Studio to match your formatting standards entirely. |
|
Getting Android Studio to match our formatting standards isn't the issue here. The standards are relatively recent, and most existing code doesn't meet those standards. The key thing for PRs like this is to prevent Android Studio from reformatting existing code! |
|
Unless there's substantive discussion of this PR, I plan to integrate it in about 8 hours. |
https://hub.jmonkeyengine.org/t/joystickcompatibilitymappings-overhaul/44337
This PR adds two improvements to the JoystickCompatabilityMapping class: First of all, it allows the remapping file to specify whether a mapping is a buttom remapping or an axis remapping. Considering some gamepads will use the same name for a button and an axis, this feature will help in this field. It is an optional, backwards-compatible feature that can be enabled by adding "button." or "axis." in front of the property name.
The second change is the ability to change the effective range of axes by adding a bracketed tupple of two floats to the value
axis.Xbox\ 360\ Wireless\ Receiver.z=rx[0.0,1.0]Note that the "axis." prefix is optional, and using the range remapper implies that this remapping is for axes.