This commit is contained in:
Bel LaPointe
2023-03-20 17:30:36 -06:00
parent c58115374b
commit a51e0ef802
3 changed files with 131 additions and 0 deletions

View File

@@ -1,4 +1,6 @@
use crate::config::Engine;
use hidapi::HidApi;
use rusb::UsbContext;
pub trait InputEngine {
@@ -18,6 +20,20 @@ struct InputEngineDevice {
}
pub fn build_input_engine_device(cfg: &Engine) -> Result<Box<dyn InputEngine>, String> {
let _device_cfg = cfg.device.as_ref().unwrap();
match HidApi::new() {
Ok(api) => {
for device in api.devices() {
println!("{:#?}", device.product_string);
}
},
Err(e) => {
eprintln!("Error: {}", e);
},
};
return Err("do what".to_string());
}
pub fn build_input_engine_device_rusb(cfg: &Engine) -> Result<Box<dyn InputEngine>, String> {