Fix static list (still only partially filled out)

This commit is contained in:
Anna Rose Wiggins 2025-08-11 11:55:16 -04:00
parent ca87295359
commit dde97be4a0

View file

@ -22,7 +22,7 @@ fn main() {
} }
} }
const JOYSTICK_BUTTONS: &[evdev::KeyCode] = &[ static JOYSTICK_BUTTONS: [evdev::KeyCode; 11] = [
evdev::KeyCode::BTN_TRIGGER_HAPPY1, evdev::KeyCode::BTN_TRIGGER_HAPPY1,
evdev::KeyCode::BTN_TRIGGER_HAPPY2, evdev::KeyCode::BTN_TRIGGER_HAPPY2,
evdev::KeyCode::BTN_TRIGGER_HAPPY3, evdev::KeyCode::BTN_TRIGGER_HAPPY3,
@ -71,7 +71,9 @@ fn print_device(path: PathBuf, device: RawDevice, verbose: u8) {
if let Ok(abs_info) = device.get_absinfo() { if let Ok(abs_info) = device.get_absinfo() {
if abs_info.count() > 0 { if abs_info.count() > 0 {
println!("\tAxis Data:"); println!("\tAxis Data:");
abs_info.for_each(|info| println!("\t\t{} {}")); for (axis, info) in abs_info {
println!("\t\t{} {}-{}", axis, info.minimum(), info.maximum());
}
} }
} }
} }