add support for adding analog key events

(e.g. gamepad analog sticks)
This commit is contained in:
Lena 2023-06-04 16:41:19 +02:00 committed by Jonathan Spira
parent 0899b904c0
commit 16faf4fda5

View File

@ -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 {