Hi all! So, I'm quite new to rust and I'm a bit confused on how to implement something.
I'm currently using this cargo in my project:
https://crates.io/crates/vigem-client
With it I've successfully managed to create virtual controllers and store them in a vector, however now I need to implement a function for pressing buttons on said controllers and I'm getting very stuck.
Ideally I'd like something like this:
lazy_static! {
static ref XBOX_PADS: Mutex<Vec<Option<Arc<Mutex<Xbox360Wired<CL>>>>>> = Mutex::new(vec![None, None, None, None]);
}
fn vigem_xbox_btn(index: i32, buttons: Vec<u16>) {
// Press buttons on pad at index
}
...where I could specify the pad index and give a vector of the buttons I want being pressed. However, everything I've tried hasn't worked, and ChatGPT and GitHub Copilot keeps giving me code filled with errors. I'm lost!
Has anybody used this cargo before, or if anybody could take a look at the cargo and give me some pointers?
Thanks!