From 16faf4fda53b07454315c92f9ad07779011b68d4 Mon Sep 17 00:00:00 2001 From: Lena Date: Sun, 4 Jun 2023 16:41:19 +0200 Subject: [PATCH] add support for adding analog key events (e.g. gamepad analog sticks) --- imgui/src/io.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/imgui/src/io.rs b/imgui/src/io.rs index ada2ecff2..cc0133e7b 100644 --- a/imgui/src/io.rs +++ b/imgui/src/io.rs @@ -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 for Io {