diff --git a/glfw/src/main.zig b/glfw/src/main.zig index b108b2b0..19357dd3 100644 --- a/glfw/src/main.zig +++ b/glfw/src/main.zig @@ -6,6 +6,7 @@ const c = @cImport(@cInclude("GLFW/glfw3.h")); pub const action = @import("action.zig"); pub const hat = @import("hat.zig"); pub const key = @import("key.zig"); +pub const mod = @import("mod.zig"); pub const version = @import("version.zig"); pub fn basicTest() void { diff --git a/glfw/src/mod.zig b/glfw/src/mod.zig new file mode 100644 index 00000000..4fd01e6a --- /dev/null +++ b/glfw/src/mod.zig @@ -0,0 +1,23 @@ +//! Modifier key flags +//! +//! See glfw.SetKeyCallback for how these are used. + +const c = @cImport(@cInclude("GLFW/glfw3.h")); + +/// If this bit is set one or more Shift keys were held down. +pub const shift = C.GLFW_MOD_SHIFT; + +/// If this bit is set one or more Control keys were held down. +pub const control = C.GLFW_MOD_CONTROL; + +/// If this bit is set one or more Alt keys were held down. +pub const alt = C.GLFW_MOD_ALT; + +/// If this bit is set one or more Super keys were held down. +pub const super = C.GLFW_MOD_SUPER; + +/// If this bit is set the Caps Lock key is enabled and the glfw.lock_key_mods input mode is set. +pub const caps_lock = C.GLFW_MOD_CAPS_LOCK; + +/// If this bit is set the Num Lock key is enabled and the glfw.lock_key_mods input mode is set. +pub const num_lock = C.GLFW_MOD_NUM_LOCK;