Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/gui.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions src/zgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading