Joypad is a simple cross-platform game controller library for dotnet. It supports both USB and Bluetooth game controllers.
It was specifically created to be used by Spectron, my ZX Spectrum emulator. I needed a simple way of handling game controllers and couldn't find anything that would suit my needs. Therefore, I decided to create my own solution.
- written in C# and .NET 8
- no external dependencies other than native OS frameworks
- cross-platform, currently supports macOS, Windows and Linux
- supports USB and Bluetooth game controllers
Implementation is using IOHID, part of IOKit framework. Any controller that is compatible with MacOS should work.
Implementation is using XInput API. This is very easy to use API, but only supports controllers that are compatible with XInput. Therefore some older legacy controllers might not work. The alternative is to use DirectInput, but it is not supported by this library.
Implementation is using evdev.
See DemoApp for a simple example of how to use the library.
Normalize output values for analog controls.