mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-14 03:25:50 +00:00
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.
This commit is contained in:
committed by
Mitchell Hashimoto
parent
492eb40d28
commit
c2deda3231
@@ -6107,7 +6107,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(
|
||||
@@ -6275,13 +6275,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 },
|
||||
);
|
||||
@@ -6607,12 +6607,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(
|
||||
@@ -6627,12 +6627,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(
|
||||
@@ -6677,7 +6677,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 = {} },
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user