[halsim_gui, wpilibc/j] Fixups for joystick outputs #8443
+20
−36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#8385 changed gamepad types to follow SDL_GamepadType, so 20 and 21 (previously
kHIDJoystickandkHIDGamepad, respectively) are no longer valid constants. This meant that after leaving the disconnected state of the sim GUI,GamepadType.getGamepadType()would return null (since it didn't match any constants). Since there aren't analogous generic joystick and gamepad constants anymore, this PR changes GlfwSystemJoystick and KeyboardJoystick to both unconditionally report as kStandard.This also updates the GenericHID.SetRumble doc comment to reflect the two new types of rumble and changes some switch labeled statement groups to use switch rules instead. If we want to keep on using switch labeled statement groups (e.g. for consistency with C++, though GenericHID::SetRumble currently uses if-else), then I could drop the last change- I just made it since GenericHID.setRumble() previously used switch rules and general switch rules are nice since there's no risk of fall-through.