diff options
| author | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2023-09-29 11:52:40 -0700 |
|---|---|---|
| committer | Mitchell Hashimoto <mitchell.hashimoto@gmail.com> | 2023-09-29 11:54:05 -0700 |
| commit | a2e2889f2be57146fd9bd00a01de988770163aff (patch) | |
| tree | dd08bfa12334effceb126853a80af73fc70dfc27 /src/input/KeyEncoder.zig | |
| parent | fb649e689dd7f7007061fc30ac1b3e80f1718d97 (diff) | |
input: make Key ascii functions comptime-generated
Diffstat (limited to 'src/input/KeyEncoder.zig')
| -rw-r--r-- | src/input/KeyEncoder.zig | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/input/KeyEncoder.zig b/src/input/KeyEncoder.zig index 1fe44425b..fb38f5fc8 100644 --- a/src/input/KeyEncoder.zig +++ b/src/input/KeyEncoder.zig @@ -158,10 +158,8 @@ fn kitty( } // Set the base layout key - { - if (self.event.key.codepoint()) |base| { - if (base != seq.key) seq.alternates[1] = base; - } + if (self.event.key.codepoint()) |base| { + if (base != seq.key) seq.alternates[1] = base; } } @@ -591,9 +589,7 @@ const KittySequence = struct { // Key section try writer.print("\x1B[{d}", .{self.key}); // Write our alternates - if (self.alternates[0]) |shifted| { - try writer.print(":{d}", .{shifted}); - } + if (self.alternates[0]) |shifted| try writer.print(":{d}", .{shifted}); if (self.alternates[1]) |base| { if (self.alternates[0] == null) { try writer.print("::{d}", .{base}); |
