Skip to content

Add XInput in preparation for gamepad triggers + add xmldoc#50

Merged
luttje merged 36 commits intomainfrom
feature/gamepad-trigger
Oct 22, 2023
Merged

Add XInput in preparation for gamepad triggers + add xmldoc#50
luttje merged 36 commits intomainfrom
feature/gamepad-trigger

Conversation

@luttje
Copy link
Collaborator

@luttje luttje commented Oct 18, 2023

This PR will work towards this feature: #40

I'll add a gamepad trigger that can listen for input from up to 4 different controllers.

Technically this uses XInput 1.4 which ships with Windows 8.

@luttje luttje added the enhancement New feature or request label Oct 18, 2023
@luttje luttje added this to the Launch stable (1.0.0) milestone Oct 18, 2023
@luttje luttje self-assigned this Oct 18, 2023
@luttje
Copy link
Collaborator Author

luttje commented Oct 18, 2023

Based on fadce0e here are some TODO:

  • Add 'Create/Update Opposite Mapping' option (that is default) to MappingForm
  • Ask to remove children upon removing parent mapping
  • Remove debug context menu option (oops)

This mitigates having to manually create opposite mappings so #47 doesn't happen as much.

@luttje
Copy link
Collaborator Author

luttje commented Oct 20, 2023

With 6f8d809 I added a GamePadStick trigger that allows listening for a specific GamePad Left/Right Stick action.

This still needs expanding, which I'll track here:

  • Add a trigger for GamePad button presses
  • Add a trigger for GamePad trigger (LT/RT) pulls
  • Separate the GamePadAction into GamePadButtonAction, GamePadStickAction and GamePadTriggerAction

That last task will make it easier to forward data from a trigger to an action, for example:

  • The user presses the left stick forward and to the left a bit. The GamePadStickInputBag(inputBag) contains: x=-0.1, y=0.1
  • The user has added a mapping that moves the mouse cursor by inputBag.x, inputBag.y

@luttje
Copy link
Collaborator Author

luttje commented Oct 20, 2023

Reminder to self: gamepads get id's in the order they are connected. This can cause simulated gamepad indexes to switch around if a physical gamepad is connected at a different time. To mitigate this I added a notification in f1e7c0d. It shows if a gamepad is connected and with what index on both startup and when enabling mappings.
There's no way to change indexes of gamepads after they're connected, so this is what we'll have to live with. UX-wise I'm open for suggestions on how to make this clearer to the user.

edit: This should be fixed now, turns out it was a bug. The UI also clearly shows physical and simulated gamepad indexes

@luttje
Copy link
Collaborator Author

luttje commented Oct 22, 2023

To help out I've updated the profile from @klsgh's website:
Vaydeer.k2j.json

Profiles may break again before we hit 1.0.0, but with the pre-release from PR it should work.

@luttje luttje marked this pull request as ready for review October 22, 2023 08:22
@luttje luttje merged commit 6b38fe9 into main Oct 22, 2023
@luttje luttje deleted the feature/gamepad-trigger branch October 22, 2023 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Development

Successfully merging this pull request may close these issues.

1 participant