About this mod
Emulates keyboard and mouse inputs when controller buttons are pressed.
- Requirements
- Permissions and credits
- Changelogs
It is configurable via an included INI file that must be edited by the user. As of the current version, it has the following options:
- GameModeOnly - Disables the emulated inputs during MenuMode. (default: true)
- ShiftButton - Sets a button as a "shift" button, enabling a second set of key mappings while held. Values here.
- DisabledButtons - Prevents the game from reading inputs from specified buttons using the values listed here.
You can set each button on the controller to a DX scancode listed here. Use decimal values.
Hypothetical Scenario:
You want to use the [LB] button to throw grenades with B42 Quickthrow.
Solution: Replace an existing control
- Set the LEFT_SHOULDER setting in the INI to 34. (This assumes the default keybind of 'G' is used for B42 Quickthrow. 34 is the decimal scancode for the 'G' key.)
- Set the DisabledButtons setting to 256 to disable all game detection of the [LB] button (256 is the button code for the [LB] button) -OR- unmap the [LB] button in the game's settings menu (which requires lStewieAl's Tweaks installed). Either option completely disables the usage of the TogglePOV control unless you rebind that control to another button in the game's settings. Do you really need 8 hotkeys on the d-pad?
With this setup, pressing the [LB] button in-game will activate the "weapon throw" function from Quickthrow by faking the 'G' key.
This method completely removes a control input from the controller in order to replace it with other functionality from a mod that detects a keypress. That can work well if you only have one or two keypresses you need to fake, but another approach is needed if you want to fake a large number of them.
Hypothetical Scenario:
You want to use the the full functionality of B42 Quickthrow (throwing, cycling weapons, resetting throws) and the weapon bashing from B42 Melee Bash.
Solution: Designate a "shift" button
- Set the ShiftButton INI setting to 256. (This is set to the [GUIDE] button on XBox controllers by default. [GUIDE] isn't easy to hold while in combat, so we're using the [LB] button again in this example.)
- Set the SHIFT_BUTTON_X INI setting to 34. This is the scancode for the 'G' key used for Quickthrow's "throw weapon" key detection.
- Set the SHIFT_BUTTON_Y INI setting to 35. This is the 'H' key for Quickthrow's "change weapon" key detection.
- Set the SHIFT_BUTTON_B INI setting to 19. This is the 'R' key for Quickthrow's "reset throw" key detection.
- Set the SHIFT_BUTTON_A INI setting to 45. This is the 'X' key for Melee Bash's "bash" key detection.
While holding the [LB] button with this setup, the [X] button will activate Quickthrow's "throw weapon" function, the [Y] button will activate the "change weapon" function, the [B] button will activate the "reset throw" function, and the [A] button will activate the "bash" function from Melee Bash. Those buttons will have their normal functionality when [LB] is not held.
This method also completely removes a control input from the controller (unless you stick with the default [GUIDE] button, which has no game functionality) but allows you to map several fake keyboard inputs to the other buttons while the "shift" button is held.
Things to note while using the "shift" functionality:
- All other button inputs are disabled while the "shift" button is held. Scripts using the IsControlPressed and IsButtonPressed functions will still detect those button inputs, but the game will not. The left and right joysticks and triggers are unaffected.
- You can use the INI settings under [Controller Keys] and under [Shifted Keys] simultaneously to set up two different mappings, one with the "shift" button held and the other without.
- You can use the default [GUIDE] "shift" button and only use button mappings under [Shifted Keys] to map several keypresses without otherwise changing controller functionality or sacrificing controls by disabling their buttons.