Skip to content

Commit 2f1d380

Browse files
authored
Merge pull request #40 from Nefistofeles/main
2 parents 1ec8c63 + 9415fc3 commit 2f1d380

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/gui.zig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,8 +3443,20 @@ extern fn zguiColorConvertHSVtoRGB(h: f32, s: f32, v: f32, out_r: *f32, out_g: *
34433443
pub fn isKeyDown(key: Key) bool {
34443444
return zguiIsKeyDown(key);
34453445
}
3446+
pub fn isKeyPressed(key: Key, repeat: bool) bool {
3447+
return zguiIsKeyPressed(key, repeat);
3448+
}
3449+
pub fn isKeyReleased(key: Key) bool {
3450+
return zguiIsKeyReleased(key);
3451+
}
3452+
pub fn setNextFrameWantCaptureKeyboard(want_capture_keyboard: bool) void {
3453+
zguiSetNextFrameWantCaptureKeyboard(want_capture_keyboard);
3454+
}
34463455

34473456
extern fn zguiIsKeyDown(key: Key) bool;
3457+
extern fn zguiIsKeyPressed(key: Key, repeat: bool) bool;
3458+
extern fn zguiIsKeyReleased(key: Key) bool;
3459+
extern fn zguiSetNextFrameWantCaptureKeyboard(want_capture_keyboard: bool) void;
34483460
//--------------------------------------------------------------------------------------------------
34493461
//
34503462
// Helpers

src/zgui.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,6 +1993,18 @@ extern "C"
19931993
{
19941994
return ImGui::IsKeyDown(key);
19951995
}
1996+
ZGUI_API bool zguiIsKeyPressed(ImGuiKey key, bool repeat)
1997+
{
1998+
return ImGui::IsKeyPressed(key, repeat);
1999+
}
2000+
ZGUI_API bool zguiIsKeyReleased(ImGuiKey key)
2001+
{
2002+
return ImGui::IsKeyReleased(key);
2003+
}
2004+
ZGUI_API void zguiSetNextFrameWantCaptureKeyboard(bool want_capture_keyboard)
2005+
{
2006+
ImGui::SetNextFrameWantCaptureKeyboard(want_capture_keyboard);
2007+
}
19962008
//--------------------------------------------------------------------------------------------------
19972009
//
19982010
// DrawList

0 commit comments

Comments
 (0)