XInput Plug-In for AppGameKit Classic and Studio
[note: This is a Work-in-Progress and does not represent the final product. Functionality and Commands are subject to change]
I'm only creating a post now because I was asked to on Discord, which is where I will be posting Development Builds for help testing.
XInput is only supported on Windows, Windows Store (UWP) and Xbox Platforms., as such those are the only supported platforms by this plug-in.
For those curious why create this when there is already built-in Joystick (Controller) Support...
What this Plug-In provides is better support for Xbox Compatible Input Devices., which can provide a better Quality of Life experience for your Games.
This isn't to say it "Works Better" for the actual Inputs... but rather providing:
• Support for Force Feedback
• Support for Runtime Controller Connection & Disconnection
• Support for Headsets
• Support for Battery Information
• Support for Associated Xbox Profile with Xbox Compatible Devices
As such can allow you (on Windows or Xbox) to provide a better gaming experience for your end-users.
Current Commands:
This command simply returns an Integer that is made up of all of the pressed buttons, which can be determined with Binary Logic.
See example below:
ButtonFlags As Integer = GetGamepadButtons( ControllerID As Integer )
Button Flags
#constant XINPUT_GAMEPAD_DPAD_UP 0x0001
#constant XINPUT_GAMEPAD_DPAD_DOWN 0x0002
#constant XINPUT_GAMEPAD_DPAD_LEFT 0x0004
#constant XINPUT_GAMEPAD_DPAD_RIGHT 0x0008
#constant XINPUT_GAMEPAD_START 0x0010
#constant XINPUT_GAMEPAD_BACK 0x0020
#constant XINPUT_GAMEPAD_LEFT_THUMB 0x0040
#constant XINPUT_GAMEPAD_RIGHT_THUMB 0x0080
#constant XINPUT_GAMEPAD_LEFT_SHOULDER 0x0100
#constant XINPUT_GAMEPAD_RIGHT_SHOULDER 0x0200
#constant XINPUT_GAMEPAD_A 0x1000
#constant XINPUT_GAMEPAD_B 0x2000
#constant XINPUT_GAMEPAD_X 0x4000
#constant XINPUT_GAMEPAD_Y 0x8000
Example: Gamepad_AorB_Pressed = ( ( XINPUT_GAMEPAD_A && XINPUT_GAMEPAD_B ) || Xinput.GetGamepadButtonPressed( 0 ) )
The following commands return a value between -1.0 to 1.0 and has a default deadzone profile built-in
Magnitude As Float = GetGamepadLeftThumbstickX( ControllerID As Integer )
Magnitude As Float = GetGamepadLeftThumbstickY( ControllerID As Integer )
Magnitude As Float = GetGamepadRightThumbstickX( ControllerID As Integer )
Magnitude As Float = GetGamepadRightThumbstickY( ControllerID As Integer )
The following commands return a value between 0.0 to 1.0 and currently have no deadzone profile built-in
Magnitude As Float = GetGamepadLeftTrigger( ControllerID As Integer )
Magnitude As Float = GetGamepadRightTrigger( ControllerID As Integer )
The following commands are simple True (1) / False (0)
True/False As Integer = GetGamepadExists( ControllerID As Integer )
True/False As Integer = GetHeadsetExists(ControllerID As Integer ) // Only works with Wired Headsets directly connected to Controller at present
This is a "Special" Function that allows you to set the Motor Speeds in the Controller., accepting values between 0.0 and 1.0
Whatever you last set will continue until you set a new value.
SetVibration( ControllderID As Integer, MagnitudeLeft As Float, MagnitudeRight As Float )
------------------------------------
Now for those who tested the original Development Build., I have removed (for the moment) the Virtual Key Support.
Planned Features:
--------------------------
Virtual Key Support
Headset Audio Support (Record and Playback through associated Headset)
Recorded Audio to Sound Memblock
Recorded Audio to Network Packet
Xbox One and Series Impulse Trigger Support (Windows 10 and 11 only)
Support for up to 8 Devices (Windows 10 and 11 only)
Returning the Xbox Profile Information associated with the Controller (Windows 8, 10 and 11)
Battery and Connection Information
Gamepad Feature Support Information
Share Button Support (Windows 10 and 11 only)
Help Files
Installer Package