Skip to content

Commit

Permalink
add support for adding analog key events
Browse files Browse the repository at this point in the history
(e.g. gamepad analog sticks)
  • Loading branch information
adryzz authored and sanbox-irl committed Sep 17, 2023
1 parent 0899b90 commit 16faf4f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions imgui/src/io.rs
Expand Up @@ -459,6 +459,12 @@ impl Io {
sys::ImGuiIO_AddKeyEvent(self.raw_mut(), key as u32, down);
}
}

pub fn add_key_analog_event(&mut self, key: Key, down: bool, value: f32) {
unsafe {
sys::ImGuiIO_AddKeyAnalogEvent(self.raw_mut(), key as u32, down, value);
}
}
}

impl Index<Key> for Io {
Expand Down

0 comments on commit 16faf4f

Please sign in to comment.