diff --git a/src-slider_io/src/output/hori.rs b/src-slider_io/src/output/hori.rs index 5bf8640..119b804 100644 --- a/src-slider_io/src/output/hori.rs +++ b/src-slider_io/src/output/hori.rs @@ -59,7 +59,7 @@ impl OutputHandler for HoriOutput { fn tick(&mut self, flat_input: &Vec) -> bool { let hori_state = match self.slider_only { false => HoriState::from_flat(flat_input), - true => HoriState::from_flat_to_wide(flat_input) + true => HoriState::from_flat_to_wide(flat_input), }; let buttons: u16 = hori_state @@ -78,7 +78,11 @@ impl OutputHandler for HoriOutput { true => code, false => 0, } - }); + }) + | match hori_state.extra[0] { + true => 1 << 13, // options + false => 0, + }; let axis: u32 = hori_state .slider diff --git a/src-slider_io/src/shared/hori.rs b/src-slider_io/src/shared/hori.rs index 0eaffef..706dd9f 100644 --- a/src-slider_io/src/shared/hori.rs +++ b/src-slider_io/src/shared/hori.rs @@ -1,6 +1,7 @@ pub struct HoriState { pub slider: [bool; 16], pub bt: [bool; 4], + pub extra: [bool; 1], } impl HoriState { @@ -8,6 +9,7 @@ impl HoriState { let mut hori_state = Self { slider: [false; 16], bt: [false; 4], + extra: [false; 1], }; for (idx, i) in flat_input[0..32].iter().enumerate() { @@ -22,6 +24,8 @@ impl HoriState { } } + hori_state.extra[0] = flat_input[38]; + hori_state } @@ -29,12 +33,15 @@ impl HoriState { let mut hori_state = Self { slider: [false; 16], bt: [false; 4], + extra: [false; 1], }; for (idx, i) in flat_input[0..32].iter().enumerate() { hori_state.slider[idx / 2] |= *i; } + hori_state.extra[0] = flat_input[38]; + hori_state } }