diff options
Diffstat (limited to 'src/sdl.zig')
-rw-r--r-- | src/sdl.zig | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sdl.zig b/src/sdl.zig index d9828af..c7b9906 100644 --- a/src/sdl.zig +++ b/src/sdl.zig @@ -54,9 +54,13 @@ pub fn get_event() event { _ = sdl.SDL_PollEvent(&e); var key = keys.none; + if (std.meta.intToEnum(keys, e.key.keysym.sym)) |val| { + key = val; + } else |err| {} var mode = modes.mouse; - //var key = @intToEnum(keys, e.key.keysym.sym); - //var mode = @intToEnum(modes, e.type); + if (std.meta.intToEnum(modes, e.type)) |val| { + mode = val; + } else |err| {} var r: event = event{ .key = key, |