Winsoft’s Controller is a XInput API controller SDK. XInput a universal joystick controller for Windows 7, 8, 10.
In the Windows platform, you can use other joysticks, such as PlayStation Dual-Shock Controller, Nintendo Switch Pro Controller and Steam Controller if you don’t have a XBOX joystick controller.
Table of Contents
Winsoft Controller Installation
Steps:
- Go to https://www.winsoft.sk/controller.htm for the download link.
- Download the trial version.
- Install Controller.exe
- Find Winsoft’s Controller installed in C:\Program Files (x86)\Winsoft\Controller\ and example in C:\Program Files (x86)\Winsoft\Controller\Examples\Delphi\Demo.dproj.
- If you want to add Winsoft’s DirectX path controller, go to Language > Delphi > Library >
Setting up the XBOX Controller
Prior to starting, go to Control Panel > Devices and Printers.
- Right-click on the joystick icon.
- Go to Game controller settings.
- Ensure status is OK.
If the status is not OK, please install the XBOX redistributable framework 4.0 and DirectX 9.0 run-time.
Quick Joystick Support
I have made changes to the Delphi Stater Kit game Alien Invasion.
I first drag and drop the TController from the (1) component palette to form (2).
I then add code to get button press data from Controller.Buttons and respond to btUp as a Key-Up event.
Loading and Saving Controller Settings
In order to load Joystick controller settings, I load ControllerIndex. If the setting is more than 1 (i.e, 0 = (none), 1 = Device 0), I enable the Joystick Controller, or else, Joystick is disabled.
In order to save controller setting, I save the ControllerIndex.
The GIT repository for the Alien Invasion modifications to work with Winsoft Controller is at https://github.com/PolywickStudio/DelphiAlienInvasion
Winsoft sells the full-version at their website.
- Works with: Delphi, C++Builder, FMX, VCL
- Works on: Windows 32-bit, Windows 64-bit
Conclusion: In less than 30 lines of code, I have demonstrated adding Joystick support to your game. WINSOFT saves game-development time.
Check out the full WINSOFT Controller for Delphi and C++Builder.