mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
Make undo, cut, copy, paste keys mappable
This commit is contained in:
@ -252,6 +252,10 @@ typedef enum {
|
||||
GHOSTTY_KEY_BACKSPACE,
|
||||
GHOSTTY_KEY_PRINT_SCREEN,
|
||||
GHOSTTY_KEY_PAUSE,
|
||||
GHOSTTY_KEY_UNDO,
|
||||
GHOSTTY_KEY_CUT,
|
||||
GHOSTTY_KEY_COPY,
|
||||
GHOSTTY_KEY_PASTE,
|
||||
|
||||
// function keys
|
||||
GHOSTTY_KEY_F1,
|
||||
|
@ -1125,6 +1125,16 @@ pub fn default(alloc_gpa: Allocator) Allocator.Error!Config {
|
||||
.{ .paste_from_clipboard = {} },
|
||||
);
|
||||
}
|
||||
try result.keybind.set.put(
|
||||
alloc,
|
||||
.{ .key = .copy },
|
||||
.{ .copy_to_clipboard = {} },
|
||||
);
|
||||
try result.keybind.set.put(
|
||||
alloc,
|
||||
.{ .key = .paste },
|
||||
.{ .paste_from_clipboard = {} },
|
||||
);
|
||||
|
||||
// Fonts
|
||||
try result.keybind.set.put(
|
||||
|
@ -307,6 +307,10 @@ pub const Key = enum(c_int) {
|
||||
backspace,
|
||||
print_screen,
|
||||
pause,
|
||||
undo,
|
||||
cut,
|
||||
copy,
|
||||
paste,
|
||||
|
||||
// function keys
|
||||
f1,
|
||||
@ -616,6 +620,10 @@ pub const Key = enum(c_int) {
|
||||
|
||||
// These keys aren't represented in cimgui
|
||||
.plus,
|
||||
.undo,
|
||||
.cut,
|
||||
.copy,
|
||||
.paste,
|
||||
=> null,
|
||||
};
|
||||
}
|
||||
|
@ -153,6 +153,10 @@ const code_to_key = code_to_key: {
|
||||
.{ "Numpad0", .kp_0 },
|
||||
.{ "NumpadDecimal", .kp_decimal },
|
||||
.{ "NumpadEqual", .kp_equal },
|
||||
.{ "Undo", .undo },
|
||||
.{ "Cut", .cut },
|
||||
.{ "Copy", .copy },
|
||||
.{ "Paste", .paste },
|
||||
.{ "ControlLeft", .left_control },
|
||||
.{ "ShiftLeft", .left_shift },
|
||||
.{ "AltLeft", .left_alt },
|
||||
|
Reference in New Issue
Block a user