diff --git a/src/gui.zig b/src/gui.zig index f35bcfd..dd5ac0f 100644 --- a/src/gui.zig +++ b/src/gui.zig @@ -3443,8 +3443,20 @@ extern fn zguiColorConvertHSVtoRGB(h: f32, s: f32, v: f32, out_r: *f32, out_g: * pub fn isKeyDown(key: Key) bool { return zguiIsKeyDown(key); } +pub fn isKeyPressed(key: Key, repeat: bool) bool { + return zguiIsKeyPressed(key, repeat); +} +pub fn isKeyReleased(key: Key) bool { + return zguiIsKeyReleased(key); +} +pub fn setNextFrameWantCaptureKeyboard(want_capture_keyboard: bool) void { + zguiSetNextFrameWantCaptureKeyboard(want_capture_keyboard); +} extern fn zguiIsKeyDown(key: Key) bool; +extern fn zguiIsKeyPressed(key: Key, repeat: bool) bool; +extern fn zguiIsKeyReleased(key: Key) bool; +extern fn zguiSetNextFrameWantCaptureKeyboard(want_capture_keyboard: bool) void; //-------------------------------------------------------------------------------------------------- // // Helpers diff --git a/src/zgui.cpp b/src/zgui.cpp index fa6d7e0..c69f9dd 100644 --- a/src/zgui.cpp +++ b/src/zgui.cpp @@ -1993,6 +1993,18 @@ extern "C" { return ImGui::IsKeyDown(key); } + ZGUI_API bool zguiIsKeyPressed(ImGuiKey key, bool repeat) + { + return ImGui::IsKeyPressed(key, repeat); + } + ZGUI_API bool zguiIsKeyReleased(ImGuiKey key) + { + return ImGui::IsKeyReleased(key); + } + ZGUI_API void zguiSetNextFrameWantCaptureKeyboard(bool want_capture_keyboard) + { + ImGui::SetNextFrameWantCaptureKeyboard(want_capture_keyboard); + } //-------------------------------------------------------------------------------------------------- // // DrawList