- Add alt keybindings for ctrl+ins = Copy and shift+ins = Paste for non-MacOS systems

This commit is contained in:
DeftDawg
2024-12-02 02:47:42 -05:00
parent 2cb334f293
commit 1e5b02302b

View File

@ -1879,6 +1879,20 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
.{ .key = .{ .translated = .v }, .mods = mods },
.{ .paste_from_clipboard = {} },
);
// On non-MacOS desktop envs (Windows, KDE, Gnome, Xfce), ctrl+insert is an
// alt keybinding for Copy and shift+ins is an alt keybinding for Paste
if (!builtin.target.isDarwin()) {
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .insert }, .mods = .{ .ctrl = true } },
.{ .copy_to_clipboard = {} },
);
try result.keybind.set.put(
alloc,
.{ .key = .{ .translated = .insert }, .mods = .{ .shift = true } },
.{ .paste_from_clipboard = {} },
);
}
}
// Increase font size mapping for keyboards with dedicated plus keys (like german)