config: switch certain physical keybinds to unicode

Switches several default keybindings from physical key codes

`.physical = .equal // or .bracket_left or .bracket_right`

to unicode characters

`.unicode = '=' // or '[' or ']'`

to support alternative keyboard layouts like Dvorak and
keyboards with dedicated plus keys (like German layouts).

I found in testing that all of these must be fixed at once otherwise
the bracket physical keys overshadew the correct (for dvorak) plus key.
With this fix, tab and pane navigation (cmd+[], cmd+shift+[]), as well
as cmd+shift+equals and cmd+equals work as expected on dvoark layout on MacOS.
pull/9469/head
Martin Emde 2025-11-03 20:00:57 -08:00
parent bbaee5e0a0
commit ea7b7f59fd
1 changed files with 8 additions and 8 deletions

View File

@ -5704,7 +5704,7 @@ pub const Keybinds = struct {
// set the expected keybind for the menu.
try self.set.put(
alloc,
.{ .key = .{ .physical = .equal }, .mods = inputpkg.ctrlOrSuper(.{}) },
.{ .key = .{ .unicode = '=' }, .mods = inputpkg.ctrlOrSuper(.{}) },
.{ .increase_font_size = 1 },
);
try self.set.put(
@ -5872,13 +5872,13 @@ pub const Keybinds = struct {
);
try self.set.putFlags(
alloc,
.{ .key = .{ .physical = .bracket_left }, .mods = .{ .ctrl = true, .super = true } },
.{ .key = .{ .unicode = '[' }, .mods = .{ .ctrl = true, .super = true } },
.{ .goto_split = .previous },
.{ .performable = true },
);
try self.set.putFlags(
alloc,
.{ .key = .{ .physical = .bracket_right }, .mods = .{ .ctrl = true, .super = true } },
.{ .key = .{ .unicode = ']' }, .mods = .{ .ctrl = true, .super = true } },
.{ .goto_split = .next },
.{ .performable = true },
);
@ -6184,12 +6184,12 @@ pub const Keybinds = struct {
);
try self.set.put(
alloc,
.{ .key = .{ .physical = .bracket_left }, .mods = .{ .super = true, .shift = true } },
.{ .key = .{ .unicode = '[' }, .mods = .{ .super = true, .shift = true } },
.{ .previous_tab = {} },
);
try self.set.put(
alloc,
.{ .key = .{ .physical = .bracket_right }, .mods = .{ .super = true, .shift = true } },
.{ .key = .{ .unicode = ']' }, .mods = .{ .super = true, .shift = true } },
.{ .next_tab = {} },
);
try self.set.put(
@ -6204,12 +6204,12 @@ pub const Keybinds = struct {
);
try self.set.put(
alloc,
.{ .key = .{ .physical = .bracket_left }, .mods = .{ .super = true } },
.{ .key = .{ .unicode = '[' }, .mods = .{ .super = true } },
.{ .goto_split = .previous },
);
try self.set.put(
alloc,
.{ .key = .{ .physical = .bracket_right }, .mods = .{ .super = true } },
.{ .key = .{ .unicode = ']' }, .mods = .{ .super = true } },
.{ .goto_split = .next },
);
try self.set.put(
@ -6254,7 +6254,7 @@ pub const Keybinds = struct {
);
try self.set.put(
alloc,
.{ .key = .{ .physical = .equal }, .mods = .{ .super = true, .ctrl = true } },
.{ .key = .{ .unicode = '=' }, .mods = .{ .super = true, .ctrl = true } },
.{ .equalize_splits = {} },
);