summary refs log tree commit diff
path: root/src/Window.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.zig')
-rw-r--r--src/Window.zig12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Window.zig b/src/Window.zig
index 74433e8..82ae8c3 100644
--- a/src/Window.zig
+++ b/src/Window.zig
@@ -18,18 +18,20 @@
 
 usingnamespace @import("cimport.zig");
 const Error = gfz.Error;
-const Key = @import("input.zig").Key;
+const Key = input.Key;
+const Mods = input.Mods;
 const Monitor = @import("Monitor.zig");
 const checkError = gfz.checkError;
 const getError = gfz.getError;
 const gfz = @import("gfz.zig");
+const input = @import("input.zig");
 
 const Self = @This();
 const CursorPosFun = fn (window: Self, xpos: f64, ypos: f64) void;
 const KeyFun = fn (window: Self, key: Key, scancode: c_int,
-                   action: c_int, mods: c_int) void;
+                   action: c_int, mods: Mods) void;
 const MouseButtonFun = fn (window: Self, button: c_int,
-                           action: c_int, mods: c_int) void;
+                           action: c_int, mods: Mods) void;
 const SizeFun = fn (window: Self, width: c_int, height: c_int) void;
 const Impl = GLFWwindow;
 pimpl: *Impl,
@@ -47,14 +49,14 @@ fn fnCast(comptime DestType: type, comptime fun: anytype) DestType {
             pub fn callback(window: ?*Impl, key: c_int, scancode: c_int,
                             action: c_int, mods: c_int) callconv(.C) void {
                 fun(@fieldParentPtr(Self, "pimpl", &window.?).*,
-                    @intToEnum(Key, key), scancode, action, mods);
+                    @intToEnum(Key, key), scancode, action, Mods.fromInt(mods));
             }
         },
         GLFWmousebuttonfun => struct {
             pub fn callback(window: ?*Impl, button: c_int,
                             action: c_int, mods: c_int) callconv(.C) void {
                 fun(@fieldParentPtr(Self, "pimpl", &window.?).*,
-                    button, action, mods);
+                    button, action, Mods.fromInt(mods));
             }
         },
         GLFWwindowsizefun => struct {