HaloSPV3 / HCE

HCE & SPV3 projects by Miris 'n' Crew.
https://source.n2.network/hce/
14 stars 0 forks source link

Add XI->DI Trigger mappings for FireWeapon and ThrowGrenade #118

Open BinToss opened 3 years ago

BinToss commented 3 years ago

https://docs.microsoft.com/en-us/windows/win32/xinput/xinput-and-directinput#using-the-xbox-controller-with-directinput XInput (X360, XOne) gamepads map triggers to separate axes in XInput, but they share an axis when loaded by Direct Input. A Direct Input gamepad automatically maps the triggers to separate Z axes (Z, Rotation/Right Z).

Applications such as Xidi (BSD-3) and X2DCLI (no license) offer the ability to correctly map XInput gamepads to DirectInput button and axes. The former also provides several mapping presets in addition to default XInput->DInput behavior (shared axes). Additionally, Xidi allows a game to reconnect a disconnected gamepad. The default behavior requires the application/game to be restarted to detect the gamepad again.

BinToss commented 3 years ago

Xidi needs two issues fixed before we support it.

  1. The input mappings in its XInputNative preset, although functional, aren't quite what one would expect. It uses Axes 3 and 6 instead of 5 and 6 for triggers. Without Xidi, the default behavior makes the triggers share Axis 5, so it's only logical 5 is split to 5 and 6.

  2. Additionally, its virtual gamepads differ only by the player index which makes identifying them by their physical devices a trial-and-error effort. img2

BinToss commented 3 years ago

On top of that, we would need a method to load it that would be forward-compatible with a mod loader. For now, we might be able to get away with chucking it in the game's ./Controls/ folder and calling it a day.

When we begin testing a mod loader, I'll ensure non-stock modules like Xidi, Chimera, and Discord Rich Presence are moved to the new ./mods/ folder.

However, Xidi's configuration ini is loaded from the parent directory of the executable that loads its module. This functions okay, but its irritating that Xidi doesn't keep all its files in one place.