From 98aa046a4dbd1a27953a9587eca078783d0db15f Mon Sep 17 00:00:00 2001 From: Ethan Conneely Date: Thu, 2 Jan 2025 00:18:39 +0000 Subject: [PATCH] Add performable flag --- src/input/Binding.zig | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/input/Binding.zig b/src/input/Binding.zig index b2c03b674..3380896b4 100644 --- a/src/input/Binding.zig +++ b/src/input/Binding.zig @@ -36,6 +36,10 @@ pub const Flags = packed struct { /// and not just while Ghostty is focused. This may not work on all platforms. /// See the keybind config documentation for more information. global: bool = false, + + /// True if this binding can be performed then the action is + /// triggered otherwise it acts as if it doesn't exist. + performable: bool = false, }; /// Full binding parser. The binding parser is implemented as an iterator @@ -90,6 +94,9 @@ pub const Parser = struct { } else if (std.mem.eql(u8, prefix, "unconsumed")) { if (!flags.consumed) return Error.InvalidFormat; flags.consumed = false; + } else if (std.mem.eql(u8, prefix, "performable")) { + if (flags.performable) return Error.InvalidFormat; + flags.performable = true; } else { // If we don't recognize the prefix then we're done. // There are trigger-specific prefixes like "physical:" so