A library for working with the Nintendo Gamecube controller adapter.
- Official Nintendo Gamecube Controller Adapter for Wii U and Switch
- Mayflash Gamecube Controller Adapter (in "Wii U/Switch" mode)
- Other 3rd party adapters (untested)
use gc_adapter::GcAdapter; // get adapter from global context let mut adapter = GcAdapter::from_usb().unwrap(); // refresh inputs to ensure they are up to date adapter.refresh_inputs(); // read and display all controller ports dbg!(adapter.read_controllers()); // enable rumble for only ports 4 adapter.set_rumble([false, false, false, true]); std::thread::sleep(std::time::Duration::from_millis(100)); // on drop all rumble will be disabled and the USB connection // will be cleaned up let _ = adapter;
Vendor and Product IDs for adapter
A collection of which buttons are pressed
A controller port: either disconnected or otherwise.
Status of controller for the given port
A connection to a gamecube adapter
Adapter interface for libusb to provide USB access for the gamecube adapter.
An unsigned axis, representing a centered value, such as a joystick axis.
An analog control stick. Can represent either the left or right stick.
An unsigned axis, representing a positive or zero value.
Type of controller connected (Disconnected, Normal, or Wavebird)
A Gamecube Controller adapter USB payload
A trait representing a struct which provides access to a limited set of USB operations