GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
LIBGAMEPAD(3) FreeBSD Library Functions Manual LIBGAMEPAD(3)

libgamepad - Unix gamepad and joystick API

#include <libgamepad/gamepad.h>
cc -o executable files -lgamepad

Libgamepad is a C library providing a standardized API for gamepad and joystick devices under various Unix-like platforms. It consists of a high-level device-independent, interface-independent API layer which provides basic functionality for any USB gamepad or analog joystick.

The top level API has no knowledge of devices or interfaces, and utilizes the lower interface-dependent layer to access the devices.

Currently supported interfaces include the analog joystick driver (e.g. /dev/joy0 on FreeBSD) and the usbhid driver (E.g. /dev/uhid0 on FreeBSD). Future plans include support for the user-level libhid and potentially other interfaces.

/* I/O */
gamepad_t *gamepad_open(const char *device, 
			gamepad_interface_t interface, int io_flags);
int gamepad_read(gamepad_t *gp);
void gamepad_close(gamepad_t *gp);
/* Accessing data from last gamepad_read() */
int gamepad_x(gamepad_t *gp);
int gamepad_y(gamepad_t *gp);
int gamepad_z(gamepad_t *gp);
int gamepad_rz(gamepad_t *gp);
int gamepad_hat_switch(gamepad_t *gp);
int gamepad_button(gamepad_t *gp, int button);
int gamepad_num_buttons(gamepad_t *gp);
/* Device information */
int gamepad_max_x(gamepad_t *gp);
int gamepad_max_y(gamepad_t *gp);
int gamepad_max_z(gamepad_t *gp);
int gamepad_max_rz(gamepad_t *gp);
/* Mode control */
void gamepad_set_nonblock(gamepad_t *gp);
void gamepad_unset_nonblock(gamepad_t *gp);

/usr/share/misc/usb_hid_usages

Please see gamepad_test.c.

joy(4), usbhid(3), uhid(4), usbdevs(1), libhid

This is an alpha quality library. Documentation, more features, and plenty of bug fixes to come.

Jason W. Bacon

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.