Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ThemsAllTook/libstem_gamepad
Gamepad C API wrapper for OS X, Windows, and Linux
https://github.com/ThemsAllTook/libstem_gamepad
Last synced: 18 days ago
JSON representation
Gamepad C API wrapper for OS X, Windows, and Linux
- Host: GitHub
- URL: https://github.com/ThemsAllTook/libstem_gamepad
- Owner: ThemsAllTook
- License: other
- Created: 2015-04-15T16:46:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-01-06T10:36:42.000Z (10 months ago)
- Last Synced: 2024-07-31T22:56:06.129Z (3 months ago)
- Language: C
- Size: 10.9 MB
- Stars: 179
- Watchers: 16
- Forks: 31
- Open Issues: 7
-
Metadata Files:
- Readme: ReadMe.txt
- Changelog: Changes.txt
- License: License.txt
Awesome Lists containing this project
README
Gamepad provides a low-level interface for USB game controller input. Each element on an attached game controller is mapped to zero or more buttons and zero or more axes. Buttons are binary controls; axes are continuous values ranging from -1.0f to 1.0f. The presence and ordering of elements depends on the platform and driver.
Typical usage: Register a callback to notify you when a new device is attached with Gamepad_deviceAttachFunc(), then call Gamepad_init() and Gamepad_detectDevices(). Your callback will be called once per connected game controller. Also register callbacks for button and axis events with Gamepad_buttonDownFunc(), Gamepad_buttonUpFunc(), and Gamepad_axisMoveFunc(). Call Gamepad_processEvents() every frame, and Gamepad_detectDevices() occasionally to be notified of new devices that were plugged in after your Gamepad_init() call. If you're interested in knowing when a device was disconnected, you can also call Gamepad_deviceRemoveFunc() to be notified of this.
See Gamepad.h for more details.