diff --git a/src/Window.zig b/src/Window.zig index b9c57cfb9..1f5e48c27 100644 --- a/src/Window.zig +++ b/src/Window.zig @@ -764,6 +764,8 @@ fn keyCallback( }, .{ .instant = {} }); win.app.wakeup(); }, + + .close_window => win.window.setShouldClose(true), } // Bindings always result in us ignoring the char if printable diff --git a/src/config.zig b/src/config.zig index 4874f99ec..179a5b95d 100644 --- a/src/config.zig +++ b/src/config.zig @@ -159,9 +159,14 @@ pub const Config = struct { try result.keybind.set.put( alloc, - .{ .key = .up, .mods = .{ .super = true } }, + .{ .key = .n, .mods = .{ .super = true } }, .{ .new_window = {} }, ); + try result.keybind.set.put( + alloc, + .{ .key = .w, .mods = .{ .super = true } }, + .{ .close_window = {} }, + ); return result; } diff --git a/src/input/Binding.zig b/src/input/Binding.zig index dd015b0c1..63a32678e 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -134,8 +134,11 @@ pub const Action = union(enum) { /// Dev mode toggle_dev_mode: void, - /// Open a new terminal window. + /// Open a new window new_window: void, + + /// Close the current window + close_window: void, }; /// Trigger is the associated key state that can trigger an action.