Skip to content

Conversation

@Markil3
Copy link
Contributor

@Markil3 Markil3 commented Mar 17, 2021

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.

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.
@stephengold stephengold added this to the v3.4.0 milestone Mar 17, 2021
@stephengold
Copy link
Member

Thanks for contributing!

Markil3 added 2 commits March 22, 2021 15:16
# 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
@Markil3 Markil3 requested a review from stephengold March 22, 2021 21:55
@Markil3 Markil3 requested a review from stephengold March 24, 2021 15:20
Copy link
Member

@stephengold stephengold left a 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.

@Markil3
Copy link
Contributor Author

Markil3 commented Mar 24, 2021

Right. Sorry for the pain. I still haven't figured out entirely how to get Android Studio to match your formatting standards entirely.

@Markil3 Markil3 closed this Mar 24, 2021
@Markil3 Markil3 reopened this Mar 24, 2021
@stephengold
Copy link
Member

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!

@stephengold
Copy link
Member

stephengold commented Mar 24, 2021

Unless there's substantive discussion of this PR, I plan to integrate it in about 8 hours.

@stephengold stephengold merged commit 39fc410 into jMonkeyEngine:master Mar 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants